# Development

**URL:** https://meta.discourse.org/c/dev/7.md?page=7

[最新版本](https://meta.discourse.org/latest.md) · [分類](https://meta.discourse.org/categories.md) · [標簽](https://meta.discourse.org/tags.md)

**Page:** 8

---

## [每个 DButton 的唯一 locale？](https://meta.discourse.org/t/unique-locale-per-dbutton/383837)

<div class="topic-metadata">

**Author:** [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)\
**回覆:** 1\
**Last updated:** [2025年九月24日 11:45 UTC](https://meta.discourse.org/t/unique-locale-per-dbutton/383837 "2025-09-24T11:45:24Z")

</div>

如果我在 each 循环中显示多个 DButton，是否有办法为我的 en.yml 中的每个按钮标签和标题设置唯一的 locale？或者是否可以为每个按钮设置按钮标签和标题的设置……

---

## [报告：尝试替换 \`show.rss.erb\` 模板及遇到的问题](https://meta.discourse.org/t/what-is-the-officially-supported-way-to-customize-the-topic-rss-output-by-replacing-the-default-show-rss-erb-template/380824)

<div class="topic-metadata">

**Author:** [@copymonopoly](https://meta.discourse.org/u/copymonopoly)\
**回覆:** 1\
**Last updated:** [2025年八月29日 22:32 UTC](https://meta.discourse.org/t/what-is-the-officially-supported-way-to-customize-the-topic-rss-output-by-replacing-the-default-show-rss-erb-template/380824 "2025-08-29T22:32:50Z")

</div>

目标 替换 discourse/app/views/topics/show.rss.erb 中的原始 Discourse 模板。 将自定义模板放置在插件目录：discourse-XXX/app/views/topics/show.rss.erb。 目标：让 RSS 页面加载 pl……

---

## [Rails 代码在开发容器内未自动重新加载](https://meta.discourse.org/t/rails-code-is-not-auto-reloading-inside-dev-containers/383327)

<div class="topic-metadata">

**Author:** [@alisson](https://meta.discourse.org/u/alisson)\
**回覆:** 0\
**Last updated:** [2025年九月19日 17:48 UTC](https://meta.discourse.org/t/rails-code-is-not-auto-reloading-inside-dev-containers/383327 "2025-09-19T17:48:51Z")

</div>

Rails 日志在进行一些更改后： \[DEV\]：已编辑未自动加载的文件。正在重启服务器... - app/controllers/admin/admin\_controller.rb 正在重启 UNICORN I, \[2025-09-19T16:35:33.289558 #1735\] INFO -- …

---

## [获取用户选择的“原始”内容（无 Markdown）](https://meta.discourse.org/t/get-the-raw-of-the-user-selection-no-markdown/381715)

<div class="topic-metadata">

**Author:** [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)\
**回覆:** 5\
**Last updated:** [2025年九月19日 04:14 UTC](https://meta.discourse.org/t/get-the-raw-of-the-user-selection-no-markdown/381715 "2025-09-19T04:14:37Z")

</div>

我明白 quoteState.buffer 会获取用户在引用时高亮显示的 Markdown 文本，并且是传递到 quote-share-buttons-before 插件出口的其中一项（通过 this.args.data.quoteState.b… 访问）……

---

## [Discourse sso 登录重定向到 localhost:3000，而不是 4200（通过 docker 运行）](https://meta.discourse.org/t/discourse-sso-login-redirect-to-localhost-3000-not-4200-running-via-docker/383227)

<div class="topic-metadata">

**Author:** [@Shin\_210](https://meta.discourse.org/u/Shin_210)\
**回覆:** 0\
**Last updated:** [2025年九月19日 02:22 UTC](https://meta.discourse.org/t/discourse-sso-login-redirect-to-localhost-3000-not-4200-running-via-docker/383227 "2025-09-19T02:22:16Z")

</div>

Discourse sso 登录重定向到 http://localhost:3000 但 ember-cli 运行在 localhost:4200 \\n我找不到任何配置项。\\n\\nEmber CLI 在开发模式下是必需的\\n要以开发模式运行 Ember CLI，请执行此操作……

---

## [Discourse\_theme CLI 出现 OpenSSL::SSL::SSLError](https://meta.discourse.org/t/getting-openssl-sslerror-from-discourse-theme-cli/380347)

<div class="topic-metadata">

**Author:** [@gormus](https://meta.discourse.org/u/gormus)\
**回覆:** 1\
**Last updated:** [2025年九月17日 18:15 UTC](https://meta.discourse.org/t/getting-openssl-sslerror-from-discourse-theme-cli/380347 "2025-09-17T18:15:04Z")

</div>

我正在使用 OrbStack（作为 Docker Desktop 的替代品）成功地在本地运行 Discourse 网站。它提供了一个自定义主机名，并使用 SSL 证书为容器提供服务，并且没有附加 4200 端口。例如，h…

---

## [通过 API 调用创建分阶段用户](https://meta.discourse.org/t/creating-a-staged-user-with-an-api-call/84667)

<div class="topic-metadata">

**Author:** [@dmccann](https://meta.discourse.org/u/dmccann)\
**回覆:** 29\
**Last updated:** [2025年九月16日 19:14 UTC](https://meta.discourse.org/t/creating-a-staged-user-with-an-api-call/84667 "2025-09-16T19:14:31Z")

</div>

我们目前的工作流程是用户通过向自定义的收件邮箱发送邮件来提交数据，从而创建一个临时用户并向 Discourse 群组发送一条私信。 是否可以实现相同的工作流程…

---

## [自定义组合器 - tag-chooser 和 d-editor 的问题](https://meta.discourse.org/t/custom-composer-issue-with-tag-chooser-and-d-editor/381698)

<div class="topic-metadata">

**Author:** [@saish](https://meta.discourse.org/u/saish)\
**回覆:** 2\
**Last updated:** [2025年九月11日 07:20 UTC](https://meta.discourse.org/t/custom-composer-issue-with-tag-chooser-and-d-editor/381698 "2025-09-11T07:20:40Z")

</div>

我创建了一个自定义组合框，其中使用了连接器，并且我目前正在使用 HTML \`\` 元素来显示一些自定义标签。这些标签在组合框打开时从标签组中获取，但这会导致一个通知……

---

## [主题框架中兼容性条目的目的是什么？](https://meta.discourse.org/t/what-is-the-purpose-of-the-compatibility-entry-in-the-theme-skeleton/369851)

<div class="topic-metadata">

**Author:** [@Moin](https://meta.discourse.org/u/Moin)\
**回覆:** 4\
**Last updated:** [2025年九月7日 20:57 UTC](https://meta.discourse.org/t/what-is-the-purpose-of-the-compatibility-entry-in-the-theme-skeleton/369851 "2025-09-07T20:57:21Z")

</div>

这是上周添加的： 有人能解释一下目的吗？原则上，我了解该文件的用途，如文档中所述。但我不太明白现在成为 t 的意义……

---

## [添加路径到Cookie](https://meta.discourse.org/t/add-path-to-cookie/40218)

<div class="topic-metadata">

**Author:** [@rap1ds](https://meta.discourse.org/u/rap1ds)\
**回覆:** 48\
**Last updated:** [2025年九月5日 14:09 UTC](https://meta.discourse.org/t/add-path-to-cookie/40218 "2025-09-05T14:09:46Z")

</div>

当Discourse托管在子文件夹（例如/forum）时，似乎cookie仍然设置在根文件夹/上。 对我来说，这听起来像是一个潜在的安全问题。例如，如果一个论坛托管在/forum中，W ckâ€¦

---

## [使用主题组件编辑帖子](https://meta.discourse.org/t/editing-posts-using-a-theme-component/381671)

<div class="topic-metadata">

**Author:** [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)\
**回覆:** 3\
**Last updated:** [2025年九月5日 10:05 UTC](https://meta.discourse.org/t/editing-posts-using-a-theme-component/381671 "2025-09-05T10:05:32Z")

</div>

因此，我偶然想到了一个想法，允许那些拥有编辑帖子权限的用户（TL4+ 用户）能够选择文本并将其部分转换为代码块。 在参考了 Discourse AI 插件代码的一些部分之后，我……

---

## [为什么 checklist 插件不是一个主题组件？](https://meta.discourse.org/t/why-isnt-the-checklist-plugin-a-theme-component/381567)

<div class="topic-metadata">

**Author:** [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)\
**回覆:** 4\
**Last updated:** [2025年九月4日 12:32 UTC](https://meta.discourse.org/t/why-isnt-the-checklist-plugin-a-theme-component/381567 "2025-09-04T12:32:09Z")

</div>

检查列表插件不是主题组件的原因是什么？ plugin.rb 文件几乎是空的，逻辑在 JS 端：

---

## [使用新的自定义主页功能](https://meta.discourse.org/t/using-the-new-custom-homepage-feature/302496)

<div class="topic-metadata">

**Author:** [@manuel](https://meta.discourse.org/u/manuel)\
**回覆:** 36\
**Last updated:** [2025年九月4日 12:28 UTC](https://meta.discourse.org/t/using-the-new-custom-homepage-feature/302496 "2025-09-04T12:28:22Z")

</div>

正在试用新的自定义主页功能：https://github.com/discourse/discourse/pull/26291 :tada: @pmusaraj 我想知道添加组件的最佳方法是什么？ 添加自定义主页修饰符会启用 discovery.custom 路由并显示默认信息警报，该警报在 custom-homepage outlet 上渲染： 我将一个组件添加到 outlet，它会渲染出来： 但…

---

## [Azure 兼容性改进](https://meta.discourse.org/t/azure-compatibility-improvements/374064)

<div class="topic-metadata">

**Author:** [@justinm](https://meta.discourse.org/u/justinm)\
**回覆:** 2\
**Last updated:** [2025年九月3日 21:48 UTC](https://meta.discourse.org/t/azure-compatibility-improvements/374064 "2025-09-03T21:48:35Z")

</div>

大家好， 我对 Discourse 进行了一些更改，以提高其与 Azure 的兼容性。只是一些非常简单的错误修复 :slight\_smile: 希望在这里和这里对我的更改进行审查。 谢谢！

---

## [\`%{base\_path}\` 可用于对象设置描述中吗？](https://meta.discourse.org/t/can-base-path-be-used-in-object-setting-descriptions/381458)

<div class="topic-metadata">

**Author:** [@Moin](https://meta.discourse.org/u/Moin)\
**回覆:** 0\
**Last updated:** [2025年九月3日 16:29 UTC](https://meta.discourse.org/t/can-base-path-be-used-in-object-setting-descriptions/381458 "2025-09-03T16:29:59Z")

</div>

继续讨论“如何在组件的设置描述中添加指向站点设置的链接？”： 这是否也适用于对象设置？ 而不是使用 我试过 但是论坛中的链接却……

---

## [如何 fork 一个已合并到核心的插件](https://meta.discourse.org/t/how-to-fork-a-plugin-thats-now-in-core/380926)

<div class="topic-metadata">

**Author:** [@kuaza](https://meta.discourse.org/u/kuaza)\
**回覆:** 10\
**Last updated:** [2025年八月29日 16:56 UTC](https://meta.discourse.org/t/how-to-fork-a-plugin-thats-now-in-core/380926 "2025-08-29T16:56:49Z")

</div>

我打算振兴这个话题；但是，随着最新的更新，我集成了AI插件，并在切换到核心系统时，我所做的修改都丢失了。我该如何实现一个类似的解决方案……

---

## [在插件中覆盖 user\_guardian.rb（无需 fork！）](https://meta.discourse.org/t/overriding-user-guardian-rb-in-a-plugin-no-fork-necessary/174839)

<div class="topic-metadata">

**Author:** [@leighno5](https://meta.discourse.org/u/leighno5)\
**回覆:** 22\
**Last updated:** [2021年一月4日 15:34 UTC](https://meta.discourse.org/t/overriding-user-guardian-rb-in-a-plugin-no-fork-necessary/174839 "2021-01-04T15:34:41Z")

</div>

嘿，抱歉问了一个新手问题。我一直在阅读文档，但需要一些指导，拜托了。 我已经 fork 了 Discourse 并做了一些自己的修改，然后我想基于这些修改进行自己的部署。关于贡献的指南……

---

## [是否可以更改员工通知的图标？](https://meta.discourse.org/t/is-it-possible-to-change-the-icon-for-staff-notices/271436)

<div class="topic-metadata">

**Author:** [@nawthor](https://meta.discourse.org/u/nawthor)\
**回覆:** 4\
**Last updated:** [2025年八月29日 10:50 UTC](https://meta.discourse.org/t/is-it-possible-to-change-the-icon-for-staff-notices/271436 "2025-08-29T10:50:15Z")

</div>

请问是否可以更改员工通知上使用的图标？可以通过 CSS 或者我还没找到的某个设置来实现吗？我们最好是用自定义图片来替换，而不是使用 FA 图标。

---

## [GitHub Codespaces 的插件 devcontainer 配置](https://meta.discourse.org/t/plugin-devcontainer-config-for-github-codespaces/380851)

<div class="topic-metadata">

**Author:** [@Alteras](https://meta.discourse.org/u/Alteras)\
**回覆:** 0\
**Last updated:** [2025年八月29日 03:00 UTC](https://meta.discourse.org/t/plugin-devcontainer-config-for-github-codespaces/380851 "2025-08-29T03:00:40Z")

</div>

我最近为一个 discourse 插件制作了一个 GitHub Codespaces devcontainer 配置，该配置会自动将 discourse 核心仓库克隆到插件周围，为每个插件生成一个全新的 discourse 开发环境。 ▶ 屏幕...

---

## [人工智能背景下的图像管理](https://meta.discourse.org/t/managing-images-in-ai-context/380828)

<div class="topic-metadata">

**Author:** [@sam](https://meta.discourse.org/u/sam)\
**回覆:** 0\
**Last updated:** [2025年八月28日 22:32 UTC](https://meta.discourse.org/t/managing-images-in-ai-context/380828 "2025-08-28T22:32:20Z")

</div>

我们对 AI 环境中的图像管理有一些内部疑问，因此我想在公开场合讨论一些注意事项。 问题 LLM（大型语言模型）如今支持多种模式。所有主要供应商现在都支持……

---

## [更改标签列表的分隔方式](https://meta.discourse.org/t/change-to-how-lists-of-tags-are-separated/356258)

<div class="topic-metadata">

**Author:** [@awesomerobot](https://meta.discourse.org/u/awesomerobot)\
**回覆:** 5\
**Last updated:** [2025年八月28日 12:07 UTC](https://meta.discourse.org/t/change-to-how-lists-of-tags-are-separated/356258 "2025-08-28T12:07:08Z")

</div>

Discourse 中主题标签列表默认以逗号分隔。这不会改变，但其实现方式以及如何更改它已经改变了： 以前，我们使用 CSS 伪元素来添加逗号，但这并不理想，因为内容在技术上不是文档的一部分——屏幕阅读器无法访问它，无法选择它，网络爬虫也看不到它…… 今天合并的此更改将标签分隔符移至了正确的 HTML：FEATURE: customizable tag separator with value transformer in p…

---

## [自定义组合器全屏问题](https://meta.discourse.org/t/custom-composer-fullscreen-issue/380619)

<div class="topic-metadata">

**Author:** [@saish](https://meta.discourse.org/u/saish)\
**回覆:** 4\
**Last updated:** [2025年八月28日 06:15 UTC](https://meta.discourse.org/t/custom-composer-fullscreen-issue/380619 "2025-08-28T06:15:51Z")

</div>

我创建了一个自定义的 composer，使用了 composer-fields connector，它在标准的（停靠的）composer 视图中运行正常。但是，切换到全屏模式时，自定义设置没有出现。我认为这……

---

## [如何查看表单工具包数据是否已更改？](https://meta.discourse.org/t/how-to-see-if-form-toolkit-data-is-dirty/380228)

<div class="topic-metadata">

**Author:** [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**回覆:** 0\
**Last updated:** [2025年八月25日 19:04 UTC](https://meta.discourse.org/t/how-to-see-if-form-toolkit-data-is-dirty/380228 "2025-08-25T19:04:01Z")

</div>

继续 Discourse toolkit 渲染表单的讨论:slight\_smile: 我希望我的保存按钮仅在有内容可保存时才可用。 在所有插件中搜索 isDirty 找不到任何内容。T…

---

## [关于实时进度条主题组件的建议或功能建议](https://meta.discourse.org/t/advice-or-feature-suggestions-for-a-real-time-progress-bar-theme-component/255622)

<div class="topic-metadata">

**Author:** [@Canapin](https://meta.discourse.org/u/Canapin)\
**回覆:** 5\
**Last updated:** [2025年八月25日 12:42 UTC](https://meta.discourse.org/t/advice-or-feature-suggestions-for-a-real-time-progress-bar-theme-component/255622 "2025-08-25T12:42:50Z")

</div>

大家好！ 我正在开发一个进度条主题组件原型。 最初的目的是在我的论坛上为用户提供一个捐赠进度条，因为服务器费用是由我们的用户通过我的 ko-fi.com 账户支付的。 每次进行 ko-fi 捐赠时，ko-fi 都会向我编写的一个 PHP 脚本发送一个请求，该脚本会触发一个请求到 Discourse 来更新当前的金额设置。 PHP 脚本部分与该组件没有直接关系，我希望有一个可以用于许多其他目的的组件。 我没有能力创建复杂的组件，…

---

## [插件模态组件导入错误 - 遵循官方文档但仍出现错误](https://meta.discourse.org/t/plugin-modal-component-import-error-followed-official-docs-but-still-getting-errors/380016)

<div class="topic-metadata">

**Author:** [@joo](https://meta.discourse.org/u/joo)\
**回覆:** 3\
**Last updated:** [2025年八月24日 02:35 UTC](https://meta.discourse.org/t/plugin-modal-component-import-error-followed-official-docs-but-still-getting-errors/380016 "2025-08-24T02:35:00Z")

</div>

问题摘要 我正在开发一个 Discourse 插件，该插件会添加一个工具栏按钮来打开一个模态表单。我已按照官方 DModal API 迁移文档一步一步进行操作，但仍然收到模块导入错误，并且……

---

## [富文本编辑器 + 主题组件](https://meta.discourse.org/t/rich-editor-theme-component/378773)

<div class="topic-metadata">

**Author:** [@Joshua\_Lyon](https://meta.discourse.org/u/Joshua_Lyon)\
**回覆:** 0\
**Last updated:** [2025年八月15日 17:09 UTC](https://meta.discourse.org/t/rich-editor-theme-component/378773 "2025-08-15T17:09:26Z")

</div>

我的目标是，当用户包含指向特定 URL（域名 + 基本路径）的链接时，我可以自动以特殊格式显示它。 我可以在渲染的帖子中使用 decorateCookedElement 来实现这一点……

---

## [Glimmer 组件更改检测未生效 - @tracked 数组中属性突变](https://meta.discourse.org/t/glimmer-component-change-detection-not-working-mutating-properties-in-tracked-array/378246)

<div class="topic-metadata">

**Author:** [@Steve\_John](https://meta.discourse.org/u/Steve_John)\
**回覆:** 5\
**Last updated:** [2025年八月14日 17:13 UTC](https://meta.discourse.org/t/glimmer-component-change-detection-not-working-mutating-properties-in-tracked-array/378246 "2025-08-14T17:13:19Z")

</div>

大家好！\\n\\n我在 Glimmer 组件中遇到变更检测问题，需要一些指导。当我修改 \`@tracked\` 数组中对象的属性时，模板不会重新渲染。\\n\*\*我的设置：\*\*\\n\`\`……

---

## [自定义 JavaScript 仅在刷新后应用，为位置插件创建类别](https://meta.discourse.org/t/custom-javascript-gets-only-applied-after-refresh-creating-categories-for-location-plugin/378365)

<div class="topic-metadata">

**Author:** [@opcourdis](https://meta.discourse.org/u/opcourdis)\
**回覆:** 9\
**Last updated:** [2025年八月13日 03:20 UTC](https://meta.discourse.org/t/custom-javascript-gets-only-applied-after-refresh-creating-categories-for-location-plugin/378365 "2025-08-13T03:20:47Z")

</div>

您好， 下面的脚本在位置插件中永久显示工具提示，并为其着色，以便根据其类型（事件、场馆等）进行排序。我正在处理图例和可能的过滤器。 情况是……

---

## [CI 中出现意外错误](https://meta.discourse.org/t/unexpected-error-in-discourse-plugin-ci/378165)

<div class="topic-metadata">

**Author:** [@merefield](https://meta.discourse.org/u/merefield)\
**回覆:** 3\
**Last updated:** [2025年八月13日 00:07 UTC](https://meta.discourse.org/t/unexpected-error-in-discourse-plugin-ci/378165 "2025-08-13T00:07:32Z")

</div>

嘿， 我收到以下错误： ActiveRecord::NoDatabaseError: 我们找不到您的数据库：discourse\_test。可用的数据库配置可以在 config/database.yml 中找到。（ActiveRecord::NoDatabaseError） 在我的 GitHub 工作区……

---

## [前端路由](https://meta.discourse.org/t/front-end-route/378346)

<div class="topic-metadata">

**Author:** [@itd-john](https://meta.discourse.org/u/itd-john)\
**回覆:** 1\
**Last updated:** [2025年八月12日 22:04 UTC](https://meta.discourse.org/t/front-end-route/378346 "2025-08-12T22:04:49Z")

</div>

jb-test.zip (526.6 KB) 大家好！我在这份示例中实现了后端路由，但无法找出连接前端的模式。如果有人有空，我将不胜感激……

[上一頁](https://meta.discourse.org/c/dev/7.md?page=6)

[下一頁](https://meta.discourse.org/c/dev/7.md?page=8)
