好的,我刚推送了一个更新,应该能修复那些无法工作的图标。我专门针对这三个图标进行了检查,现在它们都能正常使用了。在深入代码的过程中,我还将徽章名称改为不区分大小写。
下次我有机会查看这个项目时,本地化支持将是首要任务。
好的,我刚推送了一个更新,应该能修复那些无法工作的图标。我专门针对这三个图标进行了检查,现在它们都能正常使用了。在深入代码的过程中,我还将徽章名称改为不区分大小写。
下次我有机会查看这个项目时,本地化支持将是首要任务。
嗯,对我来说还是没显示。我删除后重新添加了,最后部署了一个配置更高的新实例。
如何将图标添加到您的徽章中?
您需要在任何 fab 和 far 图标前加上前缀。对于 fas 图标,直接使用名称即可。您列出的三个图标应为:
fab-linode
laptop-code
pencil-ruler
啊,原来是我的问题,谢了兄弟 ![]()
你好,Taylor,
我很喜欢你的主题,并在我的论坛上使用了它。
我遇到了一个小问题:在手机端查看时,徽章显示在用户名的左侧。
我希望将徽章移到用户名的右侧。你能帮我实现这个调整吗?
非常感谢你对社区所做的贡献。
感谢反馈,@Phạm_Quốc_Thiện!如果您更新该组件,问题应该已经全部修复。
这让我感到非常困惑,因为它暗示系统正在搜索站点徽章列表却未能找到。我尝试了强制刷新,希望能让它识别到我新增的徽章等。很高兴它现在能正常工作,但或许可以调整一下界面,将其改为普通的文本输入框,而不是执行那个无法生效的搜索功能?我认为这样会让使用体验更清晰,减少困惑。
感谢提供如此出色的主题组件。
在更新主题组件时,出现“这些本地更改将在更新中被覆盖。您确定要继续吗?”的提示正常吗?我 99.9% 确定自己没有做过任何修改,而且 Git 提交信息显示的内容似乎与更新相关,而非本地更改:
diff --git a/discourse-post-badges/about.json b/discourse-post-badges/about.json
new file mode 100644
index 0000000..eb86c4b
--- /dev/null
+++ b/discourse-post-badges/about.json
@@ -0,0 +1,15 @@
+{
+ "name": "Post Badges",
+ "component": true,
+ "license_url": "https://github.com/tshenry/discourse-post-badges/blob/master/LICENSE",
+ "about_url": "https://meta.discourse.org/t/post-badges-component/114722",
+ "authors": null,
+ "theme_version": null,
+ "minimum_discourse_version": null,
+ "maximum_discourse_version": null,
+ "assets": {
+ },
+ "color_schemes": {
+ },
+ "learn_more": "https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966"
+}
\ No newline at end of file
diff --git a/common/common.scss b/discourse-post-badges/common/common.scss
similarity index 100%
rename from common/common.scss
rename to discourse-post-badges/common/common.scss
diff --git a/common/head_tag.html b/discourse-post-badges/common/head_tag.html
similarity index 100%
rename from common/head_tag.html
rename to discourse-post-badges/common/head_tag.html
diff --git a/discourse-post-badges/settings.yml b/discourse-post-badges/settings.yml
new file mode 100644
index 0000000..7e7e250
--- /dev/null
+++ b/discourse-post-badges/settings.yml
@@ -0,0 +1,21 @@
+badges:
+ type: list
+ default: ""
+ description:
+ en: 'Use the name of the badge as it appears on the
+ <a href="/admin/badges">list of badges</a>.
+ Post badges will appear in the order they are
+ added to this setting.'
+badge_link_destination:
+ type: enum
+ default: "user's badge page"
+ choices:
+ - "badge overview page"
+ description:
+ en: "Where a user will be taken when they click on a post badge."
+only_show_highest_trust_level:
+ type: bool
+ default: false
+ description:
+ en: "When including trust level badges (Basic, Member, Regular, Leader),
+ only show the highest trust level a user has earned."
编辑补充:我执行了更新,一切正常。所以……
主题设置 UI 是 Discourse 核心功能的一部分,因此我无法在组件本身中对此设置进行任何改进。我确实希望它变得更加直观,或者在未来能够动态填充一个可搜索的列表。
至于本地更改通知,我认为除非你使用了 编辑 CSS/HTML 按钮进行了修改,否则不应该向你发出警告。你使用的是旧版本的 Discourse 吗?据我所知,该行为已在 FIX: copy local theme changes to correct temp folder when diffing upd… · discourse/discourse@5cf5e73 · GitHub 中修复(cc @pmusaraj)
是的,旧版本。谢谢。
感谢您的支持。现在一切完美。![]()
![]()
我们正在使用“主题列表预览”插件的新作品集功能,并修改了主题徽章代码,使作品集图标链接到用户个人资料,而不是指向徽章页面:
if(badge.url) {
// override Bart
if(badge.name == 'portfolio' ) {
username = badge.url.substring(badge.url.lastIndexOf('=') + 1);
user_portfolio_url = '/u/' + username + '/activity/portfolio';
iconBody = dec.h("a", { attributes: { href: user_portfolio_url } }, iconBody);
} else {
iconBody = dec.h("a", { attributes: { href: badge.url } }, iconBody);
}
// end override Bart
}
我意识到在组件更新时这段代码将会丢失,因此想知道是否有更好的实现方式?例如,我是否可以以某种方式覆盖 buildBadge 函数?
背景信息:我们只想为实际拥有作品集的用户显示此图标,也就是说,他们至少在我们的“艺术作品”分类下创建过一个主题。这可以通过徽章查询轻松实现,而且既然我们的网站已经在使用“帖子徽章”组件,这种方法看起来是合理的。
具体是什么功能目前无法使用?
在我的桌面端和手机上,我仍然能看到用户名、姓名、头衔和徽章。
太好了,我刚刚查看了主题创建者网站,情况并非如此。
继续加油,我的朋友,圣诞快乐!
好的,我有点手忙脚乱。我尝试了几个,但不得不点击“创建”,它们在搜索时并没有出现。
之后“领导者”出现了,但“机车呼吸”没有。

难道我只是患上了“阅读不足综合征”吗?
另外,能否从不想显示它们的个人那里移除它们?
还有,
这个显示了 URL:
那个显示了标题:

针对搜索徽章功能无法使用的具体问题,是的。这是我在上面几条帖子中提到的一个已知的 UI 问题。
我需要一个徽章来表示这个 ![]()
@bartv,我肯定会在不久的将来对这一组件进行一次改进/重构。我会看看能否重新调整结构,以便你能在一个独立的主题组件中处理覆盖设置。我不确定何时能着手处理此事,但一旦有进展,我定会在此话题中更新。
目前还不行,但下次我处理该组件时会记在心里。
没错,参见:
当我着手更新此组件时,我会看看能否为此提出更优雅的解决方案。