Skip to content

Commit 5b9cf8f

Browse files
dominikstrbdavidsroth
authored andcommitted
Add altmetric badges to paper (alshedivat#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.
1 parent 00b1233 commit 5b9cf8f

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ There are several custom bibtex keywords that you can use to affect how the entr
421421
- `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)
422422
- `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)
423423
- `website`: Adds a "Website" button redirecting to the specified link
424+
- `altmetric`: Adds an [Altmetric](https://www.altmetric.com/) badge (Note: only add the altmetric identifier here - the link is generated automatically)
424425

425426
You can implement your own buttons by editing the bib.html file.
426427

_config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ scholar:
251251
query: "@*"
252252

253253
# Filter out certain bibtex entry keywords used internally from the bib output
254-
filtered_bibtex_keywords: [abbr, abstract, arxiv, bibtex_show, html, pdf, selected, supp, blog, code, poster, slides, website, preview]
254+
filtered_bibtex_keywords: [abbr, abstract, arxiv, bibtex_show, html, pdf, selected, supp, blog, code, poster, slides, website, preview, altmetric]
255255

256256
# Maximum number of authors to be shown for each publication (more authors are visible on click)
257257
max_author_limit: 3 # leave blank to always show all authors

_layouts/bib.html

+3
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@
177177
{%- if entry.website %}
178178
<a href="{{ entry.website }}" class="btn btn-sm z-depth-0" role="button">Website</a>
179179
{%- endif %}
180+
{%- if entry.altmetric %}
181+
<script type="text/javascript" src="https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js"></script><div data-altmetric-id="{{ entry.altmetric }}" class="altmetric-embed" data-hide-no-mentions="true" data-hide-less-than="15" data-badge-popover="right" data-badge-type="2" style="display:inline"></div>
182+
{%- endif %}
180183
</div>
181184

182185
{% if entry.abstract -%}

0 commit comments

Comments
 (0)