0

I am trying to get an Altmetric badge to show in an html Markdown/Bookdown document with no luck. I am using the "default" badge that appears here: https://www.altmetric.com/products/altmetric-badges/

See a minimal version of the code below:

---
header-includes: null
output:
  html_document:
    df_print: paged
---

# Altmetric badge 

<div data-badge-popover="right" data-badge-type="medium-donut" data-doi="10.1038/nature.2014.14583" data-hide-no-mentions="true" class="altmetric-embed"></div>

Any help would be greatly appreciated.

Gorka
  • 3,555
  • 1
  • 31
  • 37

1 Answers1

3

The awesome people at Altmetric support gave me a way to solve it:

From the snippet in the post it looks like the embed code hasn't been added, which is essential to make the badge populate. The code is here:

 <script type='text/javascript' src='https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js'></script>

So, the complete working code:

---
header-includes: null
output:
  html_document:
    df_print: paged
---

# Altmetric badge 

<div data-badge-popover="right" data-badge-type="medium-donut" data-doi="10.1038/nature.2014.14583" data-hide-no-mentions="true" class="altmetric-embed"></div>

<script type='text/javascript' src='https://d1bxh8uas1mnw7.cloudfront.net/assets/embed.js'></script>
Gorka
  • 3,555
  • 1
  • 31
  • 37