From c87d1b446bc2f8ca8706e5cd467c7cc3c37f74ef Mon Sep 17 00:00:00 2001 From: Dominik Straub Date: Tue, 25 Oct 2022 14:27:45 +0200 Subject: [PATCH] Add altmetric badges to paper (#950) [Altmetric](https://www.altmetric.com/) tracks social media and citation activity for a paper. I added an option to add the altmeric id to a paper's bib entry, which results in the altmeric badge for the paper being displayed next to the other buttons. As an example, I added the altmetric id for the Einstein, Podolsky & Rosen paper. --- README.md | 1 + _bibliography/papers.bib | 1 + _config.yml | 2 +- _layouts/bib.html | 3 +++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 13b1f71..370f759 100644 --- a/README.md +++ b/README.md @@ -421,6 +421,7 @@ 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) You can implement your own buttons by editing the bib.html file. diff --git a/_bibliography/papers.bib b/_bibliography/papers.bib index 1c707bc..01c5213 100644 --- a/_bibliography/papers.bib +++ b/_bibliography/papers.bib @@ -42,6 +42,7 @@ url={http://link.aps.org/doi/10.1103/PhysRev.47.777}, html={https://journals.aps.org/pr/abstract/10.1103/PhysRev.47.777}, pdf={example_pdf.pdf}, + altmetric={248277}, selected={true} } diff --git a/_config.yml b/_config.yml index 0642899..c9699e8 100644 --- a/_config.yml +++ b/_config.yml @@ -255,7 +255,7 @@ scholar: query: "@*" # 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] +filtered_bibtex_keywords: [abbr, abstract, arxiv, bibtex_show, html, pdf, selected, supp, blog, code, poster, slides, website, preview, altmetric] # Maximum number of authors to be shown for each publication (more authors are visible on click) max_author_limit: 3 # leave blank to always show all authors diff --git a/_layouts/bib.html b/_layouts/bib.html index eb6520a..61da4b6 100644 --- a/_layouts/bib.html +++ b/_layouts/bib.html @@ -177,6 +177,9 @@ {%- if entry.website %} Website {%- endif %} + {%- if entry.altmetric %} +
+ {%- endif %} {% if entry.abstract -%}