Skip to content

Commit

Permalink
Add altmetric badges to paper (alshedivat#950)
Browse files Browse the repository at this point in the history
[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.
  • Loading branch information
dominikstrb authored and davidsroth committed Dec 19, 2022
1 parent 00b1233 commit 5b9cf8f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,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
Expand Down
3 changes: 3 additions & 0 deletions _layouts/bib.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@
{%- if entry.website %}
<a href="{{ entry.website }}" class="btn btn-sm z-depth-0" role="button">Website</a>
{%- endif %}
{%- if entry.altmetric %}
<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>
{%- endif %}
</div>

{% if entry.abstract -%}
Expand Down

0 comments on commit 5b9cf8f

Please sign in to comment.