# Documentation

**URL:** https://meta.discourse.org/c/documentation/10.md?page=1

[Latest](https://meta.discourse.org/latest.md) · [Categories](https://meta.discourse.org/categories.md) · [Tags](https://meta.discourse.org/tags.md)

**Page:** 2

---

## [合并用户账户](https://meta.discourse.org/t/merging-user-accounts/275288)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 5\
**Last updated:** [2026 年9 月 3 日 14:39 UTC](https://meta.discourse.org/t/merging-user-accounts/275288 "2026-09-03T14:39:41Z")

</div>

:bookmark: 本指南介绍了如何将多个用户账户合并为一个 Discourse 账户。内容涵盖通过 Discourse 界面合并非管理员用户，以及通过控制台合并管理员用户。 …

---

## [在 Discourse 中启用原生 LLMs.txt 支持](https://meta.discourse.org/t/enabling-native-llms-txt-support-in-discourse/383088)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 3\
**Last updated:** [2026 年9 月 2 日 18:18 UTC](https://meta.discourse.org/t/enabling-native-llms-txt-support-in-discourse/383088 "2026-09-02T18:18:02Z")

</div>

:bookmark: 本指南介绍了如何通过 llms.txt 标准让您的社区被 AI 智能体和 LLM 爬虫发现和使用。内容涵盖自动生成的默认文档以及自定义上传…

---

## [Discourse toolkit to render forms](https://meta.discourse.org/t/discourse-toolkit-to-render-forms/326439)

<div class="topic-metadata">

**Author:** [@system](https://meta.discourse.org/u/system)\
**Replies:** 28\
**Last updated:** [2025 年12 月 23 日 17:55 UTC](https://meta.discourse.org/t/discourse-toolkit-to-render-forms/326439 "2025-12-23T17:55:56Z")

</div>

Basic Usage FormKit exposes a single component as its public API: \<Form /\>. All other elements are yielded as contextual components, modifiers, or plain data. Every form is composed of one or multiple fields, represen…

---

## [Drag, resize, and gesture primitives](https://meta.discourse.org/t/drag-resize-and-gesture-primitives/410549)

<div class="topic-metadata">

**Author:** [@system](https://meta.discourse.org/u/system)\
**Replies:** 0\
**Last updated:** [2026 年8 月 20 日 16:44 UTC](https://meta.discourse.org/t/drag-resize-and-gesture-primitives/410549 "2026-08-20T16:44:52Z")

</div>

ui-kit ships the input-driven gesture primitives: dragging a payload onto a target, resizing a region, and reading a swipe or a pointer drag. This page is the usage reference. Each primitive’s own TSDoc carries the f…

---

## [JavaScript type hinting & validation (typescript)](https://meta.discourse.org/t/javascript-type-hinting-validation-typescript/395136)

<div class="topic-metadata">

**Author:** [@system](https://meta.discourse.org/u/system)\
**Replies:** 0\
**Last updated:** [2026 年2 月 4 日 10:38 UTC](https://meta.discourse.org/t/javascript-type-hinting-validation-typescript/395136 "2026-02-04T10:38:25Z")

</div>

Discourse ships type information for its JavaScript code. This can provide inline documentation, autocomplete, and other useful IDE features. It can also be used for some basic type validation, using the @ts-check direct…

---

## [AppEvents Triggers Reference](https://meta.discourse.org/t/appevents-triggers-reference/338465)

<div class="topic-metadata">

**Author:** [@system](https://meta.discourse.org/u/system)\
**Replies:** 0\
**Last updated:** [2024 年11 月 26 日 10:20 UTC](https://meta.discourse.org/t/appevents-triggers-reference/338465 "2024-11-26T10:20:08Z")

</div>

AppEvents The AppEvent system in Discourse provides a pub/sub mechanism for handling UI updates and component interactions - and these events are triggered via calls of AppEvent.trigger. This topic consolidates a list…

---

## [Write end-to-end system specs for the Discourse user interface](https://meta.discourse.org/t/write-end-to-end-system-specs-for-the-discourse-user-interface/325937)

<div class="topic-metadata">

**Author:** [@system](https://meta.discourse.org/u/system)\
**Replies:** 3\
**Last updated:** [2025 年8 月 28 日 14:51 UTC](https://meta.discourse.org/t/write-end-to-end-system-specs-for-the-discourse-user-interface/325937 "2025-08-28T14:51:13Z")

</div>

Background Rails system specs are used to simulate the actions of a real user using the app in a browser. We use the Playwright ruby driver which is becoming an industry standard. The tests run locally and in CI out of t…

---

## [Using service objects in Discourse](https://meta.discourse.org/t/using-service-objects-in-discourse/333641)

<div class="topic-metadata">

**Author:** [@system](https://meta.discourse.org/u/system)\
**Replies:** 0\
**Last updated:** [2024 年10 月 30 日 15:56 UTC](https://meta.discourse.org/t/using-service-objects-in-discourse/333641 "2024-10-30T15:56:38Z")

</div>

Overview A service is a small object that encompasses business logic for a given action. From outside, it should be seen as a sort of black box. You provide it with parameters, it runs (including all the side effects it…

---

## [（不推荐）从主题或插件覆盖 Discourse 模板](https://meta.discourse.org/t/not-recommended-overriding-discourse-templates-from-a-theme-or-plugin/247487)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 9\
**Last updated:** [2024 年3 月 7 日 13:20 UTC](https://meta.discourse.org/t/not-recommended-overriding-discourse-templates-from-a-theme-or-plugin/247487 "2024-03-07T13:20:54Z")

</div>

理想情况下，在通过主题/插件自定义 Discourse 时，您应使用 CSS、JavaScript 插件 API 或插件插槽（plugin outlets）。如果这些方法都不适用于您的使用场景，欢迎向 Discourse 核心提交 PR，或发起一个 Devel…

---

## [防止意外序列化 ActiveRecord 模型](https://meta.discourse.org/t/preventing-accidental-serialization-of-activerecord-models/314495)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 2\
**Last updated:** [2024 年7 月 23 日 17:59 UTC](https://meta.discourse.org/t/preventing-accidental-serialization-of-activerecord-models/314495 "2024-07-23T17:59:58Z")

</div>

我们引入了一个补丁，以防止在未指定要序列化的字段的情况下意外序列化 ActiveRecord 模型。此更改确保我们能够控制包含哪些字段，从而避免潜在的 is…

---

## [在 Discourse 中创建路由并显示数据](https://meta.discourse.org/t/creating-routes-in-discourse-and-showing-data/48827)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 0\
**Last updated:** [2016 年8 月 18 日 20:18 UTC](https://meta.discourse.org/t/creating-routes-in-discourse-and-showing-data/48827 "2016-08-18T20:18:49Z")

</div>

随着时间的推移，Discourse 的复杂性不断增加，对于初学者来说，要理解数据如何从后端的 Ruby on Rails 应用程序一路传递到前端的 Ember.js 应用程序，可能会感到有些 daunting（令人望而生畏）。 本教程将……

---

## [使用 modifyClass 修改核心行为](https://meta.discourse.org/t/using-modifyclass-to-change-core-behavior/262064)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 6\
**Last updated:** [2026 年3 月 4 日 07:13 UTC](https://meta.discourse.org/t/using-modifyclass-to-change-core-behavior/262064 "2026-03-04T07:13:43Z")

</div>

对于高级主题和插件，Discourse 提供了 modifyClass 系统。该系统允许你扩展并覆盖核心 JavaScript 类中的许多功能。 何时使用 modifyClass modifyClass 应作为最后的手段……

---

## [在主题或插件中使用插件输出连接器](https://meta.discourse.org/t/using-plugin-outlet-connectors-from-a-theme-or-plugin/32727)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 12\
**Last updated:** [2024 年10 月 14 日 10:37 UTC](https://meta.discourse.org/t/using-plugin-outlet-connectors-from-a-theme-or-plugin/32727 "2024-10-14T10:37:16Z")

</div>

Discourse 包含数百个插件出口（Plugin Outlets），可用于向 Discourse 用户界面中注入新内容或替换现有内容。系统提供了“出口参数”（Outlet arguments），以便根据……对内容进行自定义。

---

## [使用 JS API](https://meta.discourse.org/t/using-the-js-api/41281)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 18\
**Last updated:** [2026 年1 月 30 日 07:30 UTC](https://meta.discourse.org/t/using-the-js-api/41281 "2026-01-30T07:30:33Z")

</div>

Discourse 的 JavaScript API 允许主题和插件对用户体验进行广泛的自定义。最简单的使用方式是：从管理面板创建新主题，点击“编辑代码”，然后前往 …

---

## [将模态框从旧版控制器迁移到新的 DModal 组件 API](https://meta.discourse.org/t/converting-modals-from-legacy-controllers-to-new-dmodal-component-api/268057)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 9\
**Last updated:** [2023 年11 月 7 日 17:05 UTC](https://meta.discourse.org/t/converting-modals-from-legacy-controllers-to-new-dmodal-component-api/268057 "2023-11-07T17:05:46Z")

</div>

:information\_source: 如果您正在实现新的 Modal，请查阅此处的主文档。本主题介绍了如何将现有的基于控制器的 Modal 迁移到新的基于组件的 API。 过去，Discourse 使用……

---

## [使用 GitHub Actions 设置持续集成](https://meta.discourse.org/t/setup-continuous-integration-using-github-actions/240150)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 8\
**Last updated:** [2025 年3 月 3 日 09:12 UTC](https://meta.discourse.org/t/setup-continuous-integration-using-github-actions/240150 "2025-03-03T09:12:26Z")

</div>

:mag: 概述 要为 Discourse 构建一个健壮的扩展，将持续集成（CI）纳入您的插件或主题组件中可能是一个明智之举。这将有助于尽早发现错误，并降低出现 bug 的可能性…

---

## [使用 Google 的「tachometer」测量 Discourse 中的 JS 性能变化](https://meta.discourse.org/t/using-googles-tachometer-to-measure-js-performance-changes-in-discourse/281158)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 0\
**Last updated:** [2023 年10 月 5 日 13:57 UTC](https://meta.discourse.org/t/using-googles-tachometer-to-measure-js-performance-changes-in-discourse/281158 "2023-10-05T13:57:29Z")

</div>

在 Discourse 核心、插件或主题中进行客户端开发时，务必考虑其对性能的影响。Google 的“Tachometer”项目提供了一种具有统计严谨性的基准测试工具，我们可以用它来……

---

## [Ember 对象所有权（getOwner、服务注入等）](https://meta.discourse.org/t/ember-object-ownership-getowner-service-injections-etc/292080)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 0\
**Last updated:** [2024 年1 月 19 日 13:28 UTC](https://meta.discourse.org/t/ember-object-ownership-getowner-service-injections-etc/292080 "2024-01-19T13:28:42Z")

</div>

:warning: 从 discourse-common/lib/get-owner 导入 getOwner 已被弃用。 如需访问例如服务，您可以使用以下几种方法。 在组件/控制器/路由中，您应使用服务注入 …

---

## [为旧版 Discourse 安装固定插件和主题版本（d-compat 分支）](https://meta.discourse.org/t/pinning-plugin-and-theme-versions-for-older-discourse-installs-d-compat-branches/272665)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 6\
**Last updated:** [2026 年7 月 17 日 10:56 UTC](https://meta.discourse.org/t/pinning-plugin-and-theme-versions-for-older-discourse-installs-d-compat-branches/272665 "2026-07-17T10:56:56Z")

</div>

:open\_book: 背景 主题和插件开发者通常希望针对 Discourse 的最新版本进行开发，而无需担心向后兼容性问题。但运行旧版 Discourse 的网站仍然需要一个版本…

---

## [如何运行 Discourse 核心、插件和主题的 QUnit 测试套件](https://meta.discourse.org/t/how-to-run-discourse-core-plugin-and-theme-qunit-test-suites/66857)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 0\
**Last updated:** [2017 年7 月 26 日 14:09 UTC](https://meta.discourse.org/t/how-to-run-discourse-core-plugin-and-theme-qunit-test-suites/66857 "2017-07-26T14:09:58Z")

</div>

Discourse 为核心功能、插件和主题提供了广泛的前端测试。一旦你拥有了可用的本地开发环境，就可以通过多种不同的方式在本地运行这些测试。 在浏览器中运行测试 C…

---

## [为 Discourse 中的 Ember 代码编写验收测试和组件测试](https://meta.discourse.org/t/write-acceptance-tests-and-component-tests-for-ember-code-in-discourse/49167)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 3\
**Last updated:** [2024 年2 月 23 日 12:42 UTC](https://meta.discourse.org/t/write-acceptance-tests-and-component-tests-for-ember-code-in-discourse/49167 "2024-02-23T12:42:10Z")

</div>

自动化测试是保护代码免受未来回归问题影响的好方法。许多人都熟悉如何在我们的 Rails 代码库中使用 rspec 来实现这一点，但对于一些人来说，JavaScript 部分可能还有些神秘……

---

## [在提交前自动执行代码检查和格式化](https://meta.discourse.org/t/automatically-lint-and-format-code-before-commits/132947)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 0\
**Last updated:** [2019 年11 月 8 日 17:16 UTC](https://meta.discourse.org/t/automatically-lint-and-format-code-before-commits/132947 "2019-11-08T17:16:12Z")

</div>

Discourse 使用 lefthook 来管理 git 钩子，并将 bin/lint 作为手动运行相同检查的主要 CLI 入口点。 如果您在本地克隆仓库中工作，请安装一次钩子： pnpm install pnpm lefthook install Aft…

---

## [托管版 Discourse 中的 staff user 是什么？](https://meta.discourse.org/t/what-is-a-staff-user-on-hosted-discourse/112219)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 0\
**Last updated:** [2019 年3 月 21 日 07:02 UTC](https://meta.discourse.org/t/what-is-a-staff-user-on-hosted-discourse/112219 "2019-03-21T07:02:36Z")

</div>

在选择 Discourse 托管方案时，您可能会注意到每个方案都有不同的管理员（Staff）数量限制： Starter：2 人 Pro：5 人（也是旧版的 Basic 方案） Business：15 人 Enterprise：无限制 本帖将帮助说明……

---

## [Discourse AI - 垃圾信息检测](https://meta.discourse.org/t/discourse-ai-spam-detection/343541)

<div class="topic-metadata">

**Author:** [@sam](https://meta.discourse.org/u/sam)\
**Replies:** 31\
**Last updated:** [2026 年8 月 28 日 01:39 UTC](https://meta.discourse.org/t/discourse-ai-spam-detection/343541 "2026-08-28T01:39:29Z")

</div>

:bookmark: 本指南将介绍如何配置和使用 Discourse AI 的垃圾邮件检测功能，包括设置过程、扫描标准、分类逻辑、自定义设置以及与 AI 分流 (AI triage) 的对比。 ……

---

## [为封闭或私密社区配置 Discourse](https://meta.discourse.org/t/configuring-discourse-for-a-closed-or-private-community/27014)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 3\
**Last updated:** [2026 年8 月 22 日 14:19 UTC](https://meta.discourse.org/t/configuring-discourse-for-a-closed-or-private-community/27014 "2026-08-22T14:19:56Z")

</div>

:bookmark: 本指南介绍如何为封闭或私密社区配置 Discourse，包括设置登录要求、用户审批流程以及仅限邀请的访问权限。 :person\_raising\_hand: 所需用户权限…

---

## [用于主题设置的 Objects 类型](https://meta.discourse.org/t/objects-type-for-theme-setting/305009)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 32\
**Last updated:** [2026 年4 月 13 日 01:45 UTC](https://meta.discourse.org/t/objects-type-for-theme-setting/305009 "2026-04-13T01:45:38Z")

</div>

我们正在为主题设置的支持类型引入一种新类型：对象（objects）。该类型可用于替代现有的 json\_schema 类型，我们计划很快弃用后者。 定义对象类型的主题设置 用于 cr…

---

## [将主题从一个 Discourse 实例移动到另一个](https://meta.discourse.org/t/move-topics-from-one-discourse-instance-to-another/38930)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 7\
**Last updated:** [2026 年8 月 20 日 19:16 UTC](https://meta.discourse.org/t/move-topics-from-one-discourse-instance-to-another/38930 "2026-08-20T19:16:58Z")

</div>

需要从一个 Discourse 实例迁移一些内容到另一个实例吗？ 有一个命令行工具可以导出单个主题、一组主题或整个分类，另一个工具则用于在另一端导入这些数据。 主题导出/…

---

## [什么是 CDCK/MoM？](https://meta.discourse.org/t/what-is-cdck-mom/407844)

<div class="topic-metadata">

**Author:** [@Falco](https://meta.discourse.org/u/Falco)\
**Replies:** 0\
**Last updated:** [2026 年7 月 16 日 22:41 UTC](https://meta.discourse.org/t/what-is-cdck-mom/407844 "2026-07-16T22:41:14Z")

</div>

如果您的 Discourse 站点由我们托管，您可能已经注意到 AI 设置中出现了一个名为 CDCK Hosted Model 或 CDCK/MoM 的大语言模型（LLM），它支持摘要、AI 搜索等功能。本帖将介绍它……

---

## [创建和管理日历](https://meta.discourse.org/t/creating-and-managing-calendars/283773)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 17\
**Last updated:** [2026 年8 月 14 日 20:52 UTC](https://meta.discourse.org/t/creating-and-managing-calendars/283773 "2026-08-14T20:52:44Z")

</div>

:bookmark: 本指南将解释如何使用 Calendar (和 Event) 插件在 Discourse 中创建和管理日历。 :person\_raising\_hand: 所需用户级别：所有用户 日历是 Discourse 中的一个强大功能……

---

## [在 Discourse 站点上向所有用户发送消息](https://meta.discourse.org/t/sending-messages-to-all-users-on-a-discourse-site/229341)

<div class="topic-metadata">

**Author:** [@Discourse](https://meta.discourse.org/u/Discourse)\
**Replies:** 8\
**Last updated:** [2026 年8 月 13 日 15:39 UTC](https://meta.discourse.org/t/sending-messages-to-all-users-on-a-discourse-site/229341 "2026-08-13T15:39:40Z")

</div>

:bookmark: 本指南介绍如何在您的 Discourse 站点上向所有用户发送私信或电子邮件，包括使用外部邮件服务或创建“公告”分类。 :person\_raising\_hand: 所需内容…

[Previous page](https://meta.discourse.org/c/documentation/10.md)

[Next page](https://meta.discourse.org/c/documentation/10.md?page=2)
