CC11001100
V2EX  ›  问与答

寻求建议:如何优雅地在 GitHub README 中展示 Contributors?

  •  
  •   CC11001100 · Oct 26, 2024 · 1629 views
    This topic created in 575 days ago, the information mentioned may be changed or developed.

    背景

    网上找了个引入一个链接就能在 GitHub 的 README 里展示 Contributors 的组件,可是是以图片形式展示的,所有 Contributors 的头像展示在一张图片里:

    https://github.com/JSREI/jQuery-hook?tab=readme-ov-file#%E5%85%ABcontributors

    这就有点难受了,没法子直接点击 Contributors 的头像跳转到对应的主页。

    诉求

    • 大佬们有没有方便接入的 Contributors 组件,最好是引入一个链接传个仓库名参数就能接入的
    • 各个 Contributors 之间是分开展示的,点击的时候能分别跳转到各个人对应的主页
    • 风格最好还是这样的圆形的头像,如果能展示每个人的 GitHub 名称就更棒了
    2 replies    2024-10-26 12:33:15 +08:00
    0o0O0o0O0o
        1
    0o0O0o0O0o  
       Oct 26, 2024   ❤️ 2
    直接访问 SVG 那肯定可以,例如 https://contrib.nn.ci/api?repo=github/open-source-survey

    但是你想把它嵌入 Markdown 应该就没办法了,大概是为了安全它渲染后其实会在 camo.githubusercontent.com 里。需要为每个人生成,但那样会让 commits 变脏。
    CC11001100
        2
    CC11001100  
    OP
       Oct 26, 2024
    @0o0O0o0O0o 试了一下确实是这样子的,看起来 GitHub 不支持直接渲染,但可以先点一次图片跳转到 https://contrib.nn.ci/api?repo=JSREI/jQuery-hook

    然后再单击头像可以跳转到主页:

    通过两次跳转曲线救国,已经比我之前使用的那个组件好很多了,感谢大佬,已经用上了!👍
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3034 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 03:15 · PVG 11:15 · LAX 20:15 · JFK 23:15
    ♥ Do have faith in what you're doing.