我记得在我们做出区分主题和主题组件的变更时,曾向 Meta 上现有的所有主题组件提交了拉取请求(PR)。
我认为这个案例之所以被遗漏,是因为它最初是作为对某个其他主题的回复,后来才被移到了 Customization > Theme 分类下的独立主题中。
@oca 你只需在该“主题”中添加一行代码,即可使其作为主题组件运行。你需要在组件的 about.json 文件中添加以下内容:
"component": true
具体操作如下:
{
"name": "带颜色的私信",
"about_url": "https://framagit.org/oca/discourse-theme-colored-private-messages ",
"license_url": "https://framagit.org/oca/discourse-theme-colored-private-messages/blob/master/LICENSE",
+ "component": true,
"assets": {
"asset-variable": "assets/background.svg"
}
}
完成上述操作后,它应能像其他组件一样正常运行,随后我们就可以为该主题添加 theme-component 标签。