如何获取 github 仓库的 startgazer 图标

how to get the startgazer icon for a github repo

我正在尝试包括 stargazer,它显示了回购的许多星星 在 Nikola 生成的计划 HTML 静态页面中。 像关注

是否有任何 UI 代码来包含它?

转到 https://buttons.github.io 和 select“加注星标”并确保“大按钮”和“显示计数”已 select。现在,您需要做的就是在“预览和代码”<textarea> 字段中复制相关 HTML。

这是您需要的生成代码。

<!-- Place this tag in your head or just before your close body tag. -->
<script async defer src="https://buttons.github.io/buttons.js"></script>

<!-- Place this tag where you want the button to render. -->
<a class="github-button"
   href="https://github.com/ntkme/github-buttons"
   data-icon="octicon-star"
   data-size="large"
   data-show-count="true"
   aria-label="Star ntkme/github-buttons on GitHub">Star</a>

这是一个带有特定用户和 repo (Facebook React) 的深色版本:

body { background: #222; }
<!-- Place this tag in your head or just before your close body tag. -->
<script async defer src="https://buttons.github.io/buttons.js"></script>

<!-- Place this tag where you want the button to render. -->
<a class="github-button"
   href="https://github.com/facebook/react"
   data-color-scheme="no-preference: dark; light: light; dark: dark;"
   data-icon="octicon-star"
   data-size="large"
   data-show-count="true"
   aria-label="Star facebook/react on GitHub">Star</a>