Install this theme component
Features
GitHub Status Indicators adds status indicators to GitHub oneboxes for issues and pull requests. Live information is provided by https://shields.io .
For example:
Hosted by us? Theme components are available to use on our Standard, Business, and Enterprise plans.
Last edited by @JammyDodger 2024-06-12T18:39:37Z
Check document Perform check on document:
23 个赞
sam
(Sam Saffron)
2019 年10 月 14 日 01:52
2
I agree with the call of not including this in core onebox, it does technically leak user IP addresses to shield.io.
I do love how it looks though. I wonder if discourse-github should take care of this long term, problem though is that there is enormous amount of work in making this work just right, so for now … the component is good.
10 个赞
nathank
(Nathan Kershaw)
2023 年5 月 10 日 18:30
3
github 插件现在可以做到这一点了吗,还是仍然需要这个主题组件?
david
(David Taylor)
2023 年5 月 10 日 20:49
4
这仍然是一个独立的主题组件。它依赖于第三方 shields.io 服务,因此我认为我们不希望将其原样移入 discourse-GitHub 插件。
从头开始实现类似功能是可能的,但这相当复杂(特别是考虑到 GitHub 的 API 速率限制)。
2 个赞
sunjam
(james.network)
2023 年9 月 20 日 15:16
5
可以与自托管的 Shields 一起使用吗?它们允许任何人使用知识共享 0 公共领域许可来托管自己的服务。
这是 Docker 镜像 https://registry.hub.docker.com/r/shieldsio/shields/
1 个赞
simon
2023 年9 月 21 日 19:46
6
james.network:
可以与自托管的 Shields 一起使用吗?
我认为上面的讨论是关于不希望将此主题组件的功能添加到 Discourse 核心代码中。这样做的原因是它会在技术上将用户的 IP 地址泄露给 shield.io。这就是为什么这是一个主题组件而不是核心代码的一部分。
它可以用于任何站点,无论是托管的还是自托管的:
1 个赞
sunjam
(james.network)
2023 年9 月 21 日 21:19
7
我很困惑,因为 Shields 可以自托管。在这种情况下,IP 不会泄露给 shield.io ,因为它会被定向到自托管的安装吗?
1 个赞
simon
2023 年9 月 21 日 21:24
8
这说得通。我想问题在于不想在 Discourse 的站点设置中添加 shields url。如果你想将此主题组件与自托管的 Shields 安装一起使用,我认为你只需要编辑这一行,将其指向你的安装,而不是 img.shields.io:
);
if (!parts) {
return;
}
let linkType = parts[3];
if (linkType === "pull") {
linkType = "pulls";
}
const imageSrc = `https://img.shields.io/github/${linkType}/detail/state/${parts[1]}/${parts[2]}/${parts[4]}?label=&style=flat-square`;
const image = document.createElement("img");
image.setAttribute("src", imageSrc);
image.classList.add("github-status-indicator");
const info = onebox.querySelector(".github-info");
if (info) {
info.appendChild(image);
}
});
},
1 个赞
david
(David Taylor)
2023 年9 月 21 日 23:16
9
我认为只要默认值保持为 img.shields.io ,为服务器 URL 添加一个主题设置将会是 pr-welcome
2 个赞