Altmetric 徽章未显示在 rmarkdown 文档中

Altmetric badge not showing in rmarkdown document

我正在尝试让 Altmetric 徽章显示在 html Markdown/Bookdown 文档中,但没有成功。我正在使用此处显示的 "default" 徽章:https://www.altmetric.com/products/altmetric-badges/

查看以下代码的最小版本:

---
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>

如有任何帮助,我们将不胜感激。

Altmetric 支持人员给了我解决问题的方法:

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>

所以,完整的工作代码:

---
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>