diff --git a/README.md b/README.md index a5ef05aeb7e1..ad322d054412 100644 --- a/README.md +++ b/README.md @@ -418,7 +418,8 @@ There are several custom bibtex keywords that you can use to affect how the entr - `poster`: Adds a "Poster" button redirecting to a specified file (if a full link is not specified, the file will be assumed to be placed in the /assets/pdf/ directory) - `slides`: Adds a "Slides" button redirecting to a specified file (if a full link is not specified, the file will be assumed to be placed in the /assets/pdf/ directory) - `website`: Adds a "Website" button redirecting to the specified link -- `altmetric`: Adds an [Altmetric](https://www.altmetric.com/) badge (Note: only add the altmetric identifier here - the link is generated automatically) +- `altmetric`: Adds an [Altmetric](https://www.altmetric.com/) badge (Note: if DOI is provided just use `true`, otherwise only add the altmetric identifier here - the link is generated automatically) +- `dimensions`: Adds an [Dimensions](https://www.dimensions.ai/) badge (Note: if DOI or PMID is provided just use `true`, otherwise only add the dimensions identifier here - the link is generated automatically) You can implement your own buttons by editing the bib.html file. diff --git a/_config.yml b/_config.yml index 033d5c477979..a128f5a4c842 100644 --- a/_config.yml +++ b/_config.yml @@ -273,6 +273,10 @@ scholar: query: "@*" +badges: # Display different badges for your pulications + altmetric_badge: true # Altmetric badge (https://www.altmetric.com/products/altmetric-badges/) + dimensions_badge: true # Dimensions badge (https://badge.dimensions.ai/) + # Filter out certain bibtex entry keywords used internally from the bib output filtered_bibtex_keywords: [abbr, abstract, arxiv, bibtex_show, html, pdf, selected, supp, blog, code, poster, slides, website, preview, altmetric] diff --git a/_includes/scripts/badges.html b/_includes/scripts/badges.html new file mode 100644 index 000000000000..b8a3ccddec36 --- /dev/null +++ b/_includes/scripts/badges.html @@ -0,0 +1,6 @@ +{%- if site.badges.altmetric_badge %} + +{%- endif %} +{%- if site.badges.dimensions_badge %} + +{%- endif %} diff --git a/_layouts/bib.html b/_layouts/bib.html index acbd98087f99..718570a98d5c 100644 --- a/_layouts/bib.html +++ b/_layouts/bib.html @@ -180,10 +180,17 @@ {%- if entry.website %} Website {%- endif %} - {%- if entry.altmetric %} -
+ + {% if site.badges %} +
+ {%- if site.badges.altmetric_badge or entry.altmetric %} + + {%- endif %} + {%- if site.badges.dimensions_badge or entry.dimensions %} + {%- endif %}
+ {%- endif %} {% if entry.abstract -%} diff --git a/_layouts/default.html b/_layouts/default.html index 2887107cc95f..6fdc4f7a9115 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -28,6 +28,7 @@ {% include scripts/bootstrap.html %} {% include scripts/masonry.html %} {% include scripts/misc.html %} + {% include scripts/badges.html %} {% include scripts/mathjax.html %} {% include scripts/analytics.html %} {% include scripts/progressBar.html %} diff --git a/_sass/_base.scss b/_sass/_base.scss index a657b8d1cd5e..8954b6c80287 100644 --- a/_sass/_base.scss +++ b/_sass/_base.scss @@ -557,6 +557,18 @@ footer.sticky-bottom { } } } + .badges { + span { + display: inline-block; + color: $black-color; + height: 100%; + padding-left: 0.5rem; + vertical-align: middle; + &:hover { + text-decoration: underline; + } + } + } .hidden { font-size: 0.875rem; max-height: 0px;