# Development

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

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

**Page:** 108

---

## [在开发环境中禁用 SSO](https://meta.discourse.org/t/disabling-sso-in-development-environment/121055)

<div class="topic-metadata">

**Author:** [@thsnyzkn](https://meta.discourse.org/u/thsnyzkn)\
**回覆:** 4\
**Last updated:** [2019年六月24日 12:17 UTC](https://meta.discourse.org/t/disabling-sso-in-development-environment/121055 "2019-06-24T12:17:19Z")

</div>

你好， 我按照这份《在 macOS 上安装 Discourse 进行开发的初学者指南》成功安装了 Discourse，一切运行正常。 不过，我修改了一些设置以启用 enable\_sso 和…

---

## [用于发起外部请求的库是什么？](https://meta.discourse.org/t/what-is-the-library-used-to-make-external-requests/120147)

<div class="topic-metadata">

**Author:** [@emanuele](https://meta.discourse.org/u/emanuele)\
**回覆:** 13\
**Last updated:** [2019年六月24日 10:51 UTC](https://meta.discourse.org/t/what-is-the-library-used-to-make-external-requests/120147 "2019-06-24T10:51:05Z")

</div>

你好， 在后台控制器中，我需要向外部服务（KeyBase）发送 HTTP GET 请求以验证用户输入。Discourse 使用哪个库来完成此操作？我尝试使用了 Faraday，但期望返回的是 JSON 响应…

---

## [禁用 Service Worker 初始化器](https://meta.discourse.org/t/disable-service-worker-initializer/116392)

<div class="topic-metadata">

**Author:** [@Jacky\_Cheng](https://meta.discourse.org/u/Jacky_Cheng)\
**回覆:** 12\
**Last updated:** [2019年六月22日 05:32 UTC](https://meta.discourse.org/t/disable-service-worker-initializer/116392 "2019-06-22T05:32:28Z")

</div>

有什么方法可以禁用 Service Worker 初始化器吗？ 因为我的网站 example.com 已注册了自己的 Service Worker，我在同一域名 example.com/forum 下嵌入了 Discourse 论坛以实现单点登录（SSO）。 Disc…

---

## [将用户添加到组的 Ruby 代码](https://meta.discourse.org/t/ruby-code-to-add-a-user-to-a-group/120865)

<div class="topic-metadata">

**Author:** [@csmu](https://meta.discourse.org/u/csmu)\
**回覆:** 2\
**Last updated:** [2019年六月21日 07:23 UTC](https://meta.discourse.org/t/ruby-code-to-add-a-user-to-a-group/120865 "2019-06-21T07:23:52Z")

</div>

我正在寻找一些 Ruby 示例代码，用于将用户添加到组中。

---

## [导入用户时设置随机密码](https://meta.discourse.org/t/setting-a-random-password-on-importing-users/120857)

<div class="topic-metadata">

**Author:** [@csmu](https://meta.discourse.org/u/csmu)\
**回覆:** 4\
**Last updated:** [2019年六月20日 19:51 UTC](https://meta.discourse.org/t/setting-a-random-password-on-importing-users/120857 "2019-06-20T19:51:44Z")

</div>

我们正在导入俱乐部会员列表。 我们为每位会员生成了随机密码，并将通过短信发送给他们，期望他们会更改自己的密码。 假设我们有一个用户的密码为 mozrT9M8Gp……

---

## [Discobot：构建自定义交互式叙事](https://meta.discourse.org/t/discobot-building-custom-interactive-narratives/120902)

<div class="topic-metadata">

**Author:** [@D8vid](https://meta.discourse.org/u/D8vid)\
**回覆:** 2\
**Last updated:** [2019年六月20日 12:34 UTC](https://meta.discourse.org/t/discobot-building-custom-interactive-narratives/120902 "2019-06-20T12:34:18Z")

</div>

这篇博客文章 https://blog.discourse.org/2017/08/who-is-discobot/ 提到，构建自定义交互式叙事是一项可能的未来功能。我正在研究开发一门语言教程，其思路如下 …

---

## [如何从插件获取最新主题列表](https://meta.discourse.org/t/how-to-get-the-latest-topics-list-from-a-plugin/120890)

<div class="topic-metadata">

**Author:** [@thymotep](https://meta.discourse.org/u/thymotep)\
**回覆:** 1\
**Last updated:** [2019年六月20日 12:05 UTC](https://meta.discourse.org/t/how-to-get-the-latest-topics-list-from-a-plugin/120890 "2019-06-20T12:05:56Z")

</div>

大家好， 我正在编辑一个 Discourse 论坛，但默认设置中找不到我想要的功能。我希望在首页上，类别显示在第一个区块（全宽），然后在下方显示最近子论坛的详细列表……

---

## [获取 403 错误：用户无法取消点赞帖子](https://meta.discourse.org/t/getting-403-for-unlike-a-post-by-the-user/120763)

<div class="topic-metadata">

**Author:** [@Vishal\_Kaushik](https://meta.discourse.org/u/Vishal_Kaushik)\
**回覆:** 5\
**Last updated:** [2019年六月19日 08:34 UTC](https://meta.discourse.org/t/getting-403-for-unlike-a-post-by-the-user/120763 "2019-06-19T08:34:53Z")

</div>

我正在尝试使用 HTTP 和 Node.js 调用 Discourse 的“取消喜欢”API。我发送的特定负载如下： host: discourseHost, port: discoursePort, path: '/post\_actions/' + parseInt(req.params.post\_id),…

---

## [覆盖“切换回复”按钮](https://meta.discourse.org/t/overriding-toggle-reply-button/120553)

<div class="topic-metadata">

**Author:** [@Ellibereth](https://meta.discourse.org/u/Ellibereth)\
**回覆:** 1\
**Last updated:** [2019年六月18日 16:29 UTC](https://meta.discourse.org/t/overriding-toggle-reply-button/120553 "2019-06-18T16:29:32Z")

</div>

这是从“能否在移动端视图中获取发布回复的链接？ - #12 by Ellibereth”的转载，但它可能更适合放在dev中，而不是那个主题里。 我正在尝试修改“toggleReplyAbove”操作，以显示一个…

---

## [在主题中使用 Font-Awesome 4 图标，但保留 FA5？](https://meta.discourse.org/t/use-font-awesome-4-icons-in-theme-but-keep-fa5/118776)

<div class="topic-metadata">

**Author:** [@Chaboi\_3000](https://meta.discourse.org/u/Chaboi_3000)\
**回覆:** 16\
**Last updated:** [2019年六月18日 08:00 UTC](https://meta.discourse.org/t/use-font-awesome-4-icons-in-theme-but-keep-fa5/118776 "2019-06-18T08:00:40Z")

</div>

我想在主题中使用某个 FA4 图标，同时保留 FA5 图标，并且不想降级到旧版本。是否可以在主题中使用某个 FA4 图标，而其他图标保持为 FA5？

---

## [RTL 语言下导航栏中徽标后的汉堡按钮](https://meta.discourse.org/t/hamburger-button-behind-the-logo-in-the-nav-with-rtl-languages/120607)

<div class="topic-metadata">

**Author:** [@verilog15](https://meta.discourse.org/u/verilog15)\
**回覆:** 2\
**Last updated:** [2019年六月18日 00:24 UTC](https://meta.discourse.org/t/hamburger-button-behind-the-logo-in-the-nav-with-rtl-languages/120607 "2019-06-18T00:24:47Z")

</div>

我注意到在移动设备上汉堡按钮的行为有些异常： 是否有快速修复方法？我在 theme-creator.discourse.org 网站上有一个示例，但我不确定如何在此处分享。

---

## [我是一名 WordPress 开发者，希望学习 Discourse 开发](https://meta.discourse.org/t/i-am-a-wordpress-developer-looking-to-learn-discourse-development/120429)

<div class="topic-metadata">

**Author:** [@fzngagan](https://meta.discourse.org/u/fzngagan)\
**回覆:** 5\
**Last updated:** [2019年六月15日 12:01 UTC](https://meta.discourse.org/t/i-am-a-wordpress-developer-looking-to-learn-discourse-development/120429 "2019-06-15T12:01:21Z")

</div>

我想了解 Discourse 的代码运作方式以及 Discourse 提供的 API，以便开发自定义功能。我或任何新人应如何着手？

---

## [插件路由问题](https://meta.discourse.org/t/plugin-routing-problems/120221)

<div class="topic-metadata">

**Author:** [@pacharanero](https://meta.discourse.org/u/pacharanero)\
**回覆:** 6\
**Last updated:** [2019年六月13日 21:35 UTC](https://meta.discourse.org/t/plugin-routing-problems/120221 "2019-06-13T21:35:44Z")

</div>

大家好，我正在开发一个插件，但在理解当前向 Ember 路由器追加路由的 API 方面遇到了一些问题。我阅读了 Meta 上的许多教程/操作指南帖子，但似乎存在许多…

---

## [共享 Cookie SSO：通知前端](https://meta.discourse.org/t/shared-cookie-sso-notifying-frontend/120012)

<div class="topic-metadata">

**Author:** [@edL](https://meta.discourse.org/u/edL)\
**回覆:** 7\
**Last updated:** [2019年六月13日 10:37 UTC](https://meta.discourse.org/t/shared-cookie-sso-notifying-frontend/120012 "2019-06-13T10:37:46Z")

</div>

我正在编写一个插件，以实现与定制系统的共享 Cookie 单点登录（SSO），但我不确定如何让 Ember 前端知晓用户已以此方式“登录”。 我已子类化了 Auth::DefaultCurrentUserProvider 并...

---

## [插入 tawk.to 小部件 JS 代码](https://meta.discourse.org/t/insert-tawk-to-widget-js-code/63510)

<div class="topic-metadata">

**Author:** [@MikesCafe](https://meta.discourse.org/u/MikesCafe)\
**回覆:** 1\
**Last updated:** [2017年五月28日 21:40 UTC](https://meta.discourse.org/t/insert-tawk-to-widget-js-code/63510 "2017-05-28T21:40:38Z")

</div>

我尝试按照说明插入tawk.to的小部件代码 但插入了代码 !--Start of Tawk.to Script-- 

---

## [Api to fetch topic by page](https://meta.discourse.org/t/api-to-fetch-topic-by-page/63342)

<div class="topic-metadata">

**Author:** [@gchiu](https://meta.discourse.org/u/gchiu)\
**回覆:** 4\
**Last updated:** [2017年五月25日 19:49 UTC](https://meta.discourse.org/t/api-to-fetch-topic-by-page/63342 "2017-05-25T19:49:55Z")

</div>

I can see there is an api to retrieve a topic, and there is a chunk\_size of 20 I see in the response. How do I get the next page? highest\_post\_number 33 deleted\_by \_ actions\_summary \[ make map! \[ id 4 …

---

## [需要帮助处理主题模板 after\_header.html](https://meta.discourse.org/t/need-help-with-theme-template-after-header-html/115773)

<div class="topic-metadata">

**Author:** [@Faye\_Polson](https://meta.discourse.org/u/Faye_Polson)\
**回覆:** 11\
**Last updated:** [2019年六月7日 20:22 UTC](https://meta.discourse.org/t/need-help-with-theme-template-after-header-html/115773 "2019-06-07T20:22:36Z")

</div>

我是 Discourse 开发的新手，过去几天一直在摸索制作主题。 我卡在尝试在 after\_header.html 中使用 Handlebars 的问题上。 我希望最终结果直接位于 … 下方。

---

## [使容器更宽](https://meta.discourse.org/t/making-the-container-wider/314572)

<div class="topic-metadata">

**Author:** [@Jugger](https://meta.discourse.org/u/Jugger)\
**回覆:** 2\
**Last updated:** [2019年六月7日 19:14 UTC](https://meta.discourse.org/t/making-the-container-wider/314572 "2019-06-07T19:14:43Z")

</div>

@awesomerobot 我似乎找不到让容器变得更宽（和默认discourse主题一样宽）的正确方法 ImgUr：互联网的魔法 有什么建议吗？

---

## [插件设计建议：全屏还是模态框？](https://meta.discourse.org/t/plugin-design-suggestion-full-page-or-modal/119669)

<div class="topic-metadata">

**Author:** [@emanuele](https://meta.discourse.org/u/emanuele)\
**回覆:** 4\
**Last updated:** [2019年六月7日 11:15 UTC](https://meta.discourse.org/t/plugin-design-suggestion-full-page-or-modal/119669 "2019-06-07T11:15:26Z")

</div>

大家好 :slight\_smile: 我正在编写一个 Keybase 证明插件，由于这是我首次尝试编写 Discourse 插件，我仍在摸索将其与产品集成的最佳方式 :slight…

---

## [拆分大型主题](https://meta.discourse.org/t/splitting-large-topics/119588)

<div class="topic-metadata">

**Author:** [@RGJ](https://meta.discourse.org/u/RGJ)\
**回覆:** 2\
**Last updated:** [2019年六月6日 09:27 UTC](https://meta.discourse.org/t/splitting-large-topics/119588 "2019-06-06T09:27:00Z")

</div>

我们有一个论坛，其中包含许多非常大的主题，需要将其拆分为多个较小的主题。 从程序化的角度来看，最佳的处理方式是什么？ 是否只需加载每篇帖子，修改帖子…

---

## [Group choice during the registration](https://meta.discourse.org/t/group-choice-during-the-registration/65809)

<div class="topic-metadata">

**Author:** [@Yohan](https://meta.discourse.org/u/Yohan)\
**回覆:** 1\
**Last updated:** [2019年六月5日 19:11 UTC](https://meta.discourse.org/t/group-choice-during-the-registration/65809 "2019-06-05T19:11:57Z")

</div>

Hi, I want to force people to choose a group during their registration. So, i have modified the file /templates/modal/create\_account.hbs in order to insert a new field. But i m unable to get the groups. How can i do? I…

---

## [为插件添加测试依赖项](https://meta.discourse.org/t/adding-testing-dependencies-for-plugins/119584)

<div class="topic-metadata">

**Author:** [@edL](https://meta.discourse.org/u/edL)\
**回覆:** 2\
**Last updated:** [2019年六月5日 15:45 UTC](https://meta.discourse.org/t/adding-testing-dependencies-for-plugins/119584 "2019-06-05T15:45:51Z")

</div>

我正在编写一个插件，它会调用外部 API。过去，我使用 VCR 来记录请求和响应，这样在我的测试自动运行时，就不会每 15 秒就频繁调用该服务。 我了解到可以使用 gem 'vcr'，版本 '5.0....'

---

## [如何在时间轴下添加按钮？](https://meta.discourse.org/t/how-to-add-buttons-under-timeline/119541)

<div class="topic-metadata">

**Author:** [@Ellibereth](https://meta.discourse.org/u/Ellibereth)\
**回覆:** 0\
**Last updated:** [2019年六月4日 23:50 UTC](https://meta.discourse.org/t/how-to-add-buttons-under-timeline/119541 "2019-06-04T23:50:54Z")

</div>

API/插件出口中是否有功能允许您在以下位置添加按钮？

---

## [Prettier：代码格式化工具](https://meta.discourse.org/t/prettier-code-formatting-tool/93212)

<div class="topic-metadata">

**Author:** [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)\
**回覆:** 4\
**Last updated:** [2019年六月3日 21:45 UTC](https://meta.discourse.org/t/prettier-code-formatting-tool/93212 "2019-06-03T21:45:37Z")

</div>

在向我们的主 Discourse 仓库创建拉取请求时，您可能会注意到一个机器人发送了以下评论消息： 我们已经在代码库中使用 Prettier 几周了，并且正在强制执行它 …

---

## [How do I extend a built-in nested route in Ember?](https://meta.discourse.org/t/how-do-i-extend-a-built-in-nested-route-in-ember/53467)

<div class="topic-metadata">

**Author:** [@sam](https://meta.discourse.org/u/sam)\
**回覆:** 3\
**Last updated:** [2016年十一月29日 18:10 UTC](https://meta.discourse.org/t/how-do-i-extend-a-built-in-nested-route-in-ember/53467 "2016-11-29T18:10:29Z")

</div>

Mainly a question for @eviltrout I am trying to extend some of the internal routes for the solved plugin. I tried adding assets/javascripts/discourse/solved-route-map.js with: export default function() { this.route(…

---

## [Discourse-webpack：一个用于开发重度 JS 的 Discourse 组件的样板文件](https://meta.discourse.org/t/discourse-webpack-a-boilerplate-for-developing-js-heavy-discourse-components/111750)

<div class="topic-metadata">

**Author:** [@labofoz](https://meta.discourse.org/u/labofoz)\
**回覆:** 1\
**Last updated:** [2019年六月3日 10:26 UTC](https://meta.discourse.org/t/discourse-webpack-a-boilerplate-for-developing-js-heavy-discourse-components/111750 "2019-06-03T10:26:54Z")

</div>

编辑 by @david：Discourse 的主题系统现已内置对多个 JS 文件的支持。此 webpack 方法不再需要。 大家好！在我开发 handsfree-discourse 组件时，遇到了一些问题…

---

## [禁用/移除按钮轮廓](https://meta.discourse.org/t/disable-remove-button-outline/118979)

<div class="topic-metadata">

**Author:** [@calebs](https://meta.discourse.org/u/calebs)\
**回覆:** 4\
**Last updated:** [2019年五月31日 08:39 UTC](https://meta.discourse.org/t/disable-remove-button-outline/118979 "2019-05-31T08:39:56Z")

</div>

在更改了所有按钮的形状后，我注意到主分类下拉菜单按钮上有一个黑色轮廓。有什么方法可以移除此轮廓吗？谢谢！

---

## [API - 获取部分群组成员](https://meta.discourse.org/t/api-get-some-group-members/119065)

<div class="topic-metadata">

**Author:** [@Robert\_Work](https://meta.discourse.org/u/Robert_Work)\
**回覆:** 2\
**Last updated:** [2019年五月30日 12:02 UTC](https://meta.discourse.org/t/api-get-some-group-members/119065 "2019-05-30T12:02:10Z")

</div>

你好！ “获取部分组成员”这个方法是否只返回组中的部分成员？ 我不想逐个添加新用户，我希望通过一次请求完成。

---

## [为具有特色视图的分类添加条件内容](https://meta.discourse.org/t/adding-conditional-content-for-categories-with-featured-view/118823)

<div class="topic-metadata">

**Author:** [@torsi](https://meta.discourse.org/u/torsi)\
**回覆:** 0\
**Last updated:** [2019年五月27日 22:35 UTC](https://meta.discourse.org/t/adding-conditional-content-for-categories-with-featured-view/118823 "2019-05-27T22:35:05Z")

</div>

我使用“带精选主题的分类”视图来管理分类和子分类。我希望根据父分类，为分类的\`\`元素添加条件内容。如果有一些独特的内容可供测试……

---

## [How to add /users on Top Menu?](https://meta.discourse.org/t/how-to-add-users-on-top-menu/63611)

<div class="topic-metadata">

**Author:** [@Filippo\_Ghermandi](https://meta.discourse.org/u/Filippo_Ghermandi)\
**回覆:** 5\
**Last updated:** [2019年五月27日 08:01 UTC](https://meta.discourse.org/t/how-to-add-users-on-top-menu/63611 "2019-05-27T08:01:19Z")

</div>

/users page works properly as a leaderboard. I was willing to add it on top menu. Is there a easy way to do it? Maybe without code :stuck\_out\_tongue:

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

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