# Development

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

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

**Page:** 66

---

## [有什么计划集成 CSS Cascade layers 吗？](https://meta.discourse.org/t/any-plans-to-integrate-css-cascade-layers/223950)

<div class="topic-metadata">

**Author:** [@keegan](https://meta.discourse.org/u/keegan)\
**回覆:** 1\
**Last updated:** [2022年四月11日 18:47 UTC](https://meta.discourse.org/t/any-plans-to-integrate-css-cascade-layers/223950 "2022-04-11T18:47:33Z")

</div>

CSS 最近引入了定义自己的级联层（cascade layers）的功能，并且似乎正在获得浏览器支持。希望很快能在所有主流浏览器中提供。 参考资料： https://developer.mozilla.org/…

---

## [在连接器模板中传递属性](https://meta.discourse.org/t/pass-property-in-connector-template/223761)

<div class="topic-metadata">

**Author:** [@j3ang](https://meta.discourse.org/u/j3ang)\
**回覆:** 1\
**Last updated:** [2022年四月9日 02:01 UTC](https://meta.discourse.org/t/pass-property-in-connector-template/223761 "2022-04-09T02:01:11Z")

</div>

我该如何使用插件API将属性传递到Handlebars模板？ 我正试图根据当前主题是否为公共主题来显示不同的文本。我正在使用topic-above-post-stream连接器出口。 我试过……

---

## [在主题和组件中延迟加载JavaScript](https://meta.discourse.org/t/defer-loading-javascript-in-themes-and-components/126370)

<div class="topic-metadata">

**Author:** [@sam](https://meta.discourse.org/u/sam)\
**回覆:** 4\
**Last updated:** [2022年四月7日 06:15 UTC](https://meta.discourse.org/t/defer-loading-javascript-in-themes-and-components/126370 "2022-04-07T06:15:18Z")

</div>

Thanks to @david we have a very clean pattern for “eager” loading JavaScript in themes. This means you just put \*.js.es6 files into the javascripts directory and it works exactly like plugins do, this is glorious. For …

---

## [Discourse JS 兼容 Google 的难度有多大？](https://meta.discourse.org/t/how-difficult-would-it-be-to-make-discourse-js-google-compliant/223388)

<div class="topic-metadata">

**Author:** [@stance455](https://meta.discourse.org/u/stance455)\
**回覆:** 3\
**Last updated:** [2022年四月5日 19:12 UTC](https://meta.discourse.org/t/how-difficult-would-it-be-to-make-discourse-js-google-compliant/223388 "2022-04-05T19:12:09Z")

</div>

我正在就 discourse 和 Google 的 Javascript 指南提出一个通用的开发者问题。我能够使用在线的 Google 移动友好测试工具测试最新的构建版本 - 屏幕截图是空白的，并且 HTM…

---

## [寻找 add\_api\_key\_scope 的用法示例](https://meta.discourse.org/t/looking-for-usage-examples-of-add-api-key-scope/198939)

<div class="topic-metadata">

**Author:** [@Hooksmith](https://meta.discourse.org/u/Hooksmith)\
**回覆:** 0\
**Last updated:** [2021年八月2日 20:30 UTC](https://meta.discourse.org/t/looking-for-usage-examples-of-add-api-key-scope/198939 "2021-08-02T20:30:53Z")

</div>

大家好， 我正在尝试使用 Plugin::Instance 上的这个方法 discourse/instance.rb at 06c60b017c86ddab489fd3d30c951c10b5c4d281 · ayampenyetan/discourse · GitHub 我尝试搜索这个方法的现有用法……

---

## [我们可以聊聊SEO吗？](https://meta.discourse.org/t/can-we-have-a-conversation-about-seo/223178)

<div class="topic-metadata">

**Author:** [@stance455](https://meta.discourse.org/u/stance455)\
**回覆:** 2\
**Last updated:** [2022年四月4日 17:22 UTC](https://meta.discourse.org/t/can-we-have-a-conversation-about-seo/223178 "2022-04-04T17:22:56Z")

</div>

我最近意识到 Discourse 为 Googlebot 提供了一个完全不同的网站版本。 …而且理所当然，我刚试着看看谷歌是否能渲染该网站的 JS 版本——显然不能（屏幕截图……

---

## [用于调试API的配方和工具](https://meta.discourse.org/t/recipes-and-tools-for-debugging-the-api/222904)

<div class="topic-metadata">

**Author:** [@maiki](https://meta.discourse.org/u/maiki)\
**回覆:** 4\
**Last updated:** [2022年四月4日 07:54 UTC](https://meta.discourse.org/t/recipes-and-tools-for-debugging-the-api/222904 "2022-04-04T07:54:02Z")

</div>

各位！ 我正在查看用户创建时的 API 500 错误，如果用户名是整数，并且只能通过 curl 来复现。我正在查阅文档，看看是否有有用的输出来帮助弄清楚……

---

## [作为一名没有编程经验的普通最终用户，如何开始 Discourse 开发？](https://meta.discourse.org/t/how-do-i-get-started-with-discourse-development-as-a-regular-end-user-with-no-programming-experience/222757)

<div class="topic-metadata">

**Author:** [@Decorbuz](https://meta.discourse.org/u/Decorbuz)\
**回覆:** 4\
**Last updated:** [2022年四月1日 17:36 UTC](https://meta.discourse.org/t/how-do-i-get-started-with-discourse-development-as-a-regular-end-user-with-no-programming-experience/222757 "2022-04-01T17:36:28Z")

</div>

我从2016年中期开始就作为普通终端用户使用Discourse。起初，我其实对它感到有些畏惧。近年来，我越来越熟悉Discourse，并爱上了它……

---

## [无法启动 localhost 服务器 -- 文件是为 x86\_64 构建的，与当前链接架构（i386）不匹配](https://meta.discourse.org/t/cant-start-localhost-server-file-was-built-for-x86-64-which-is-not-the-architecture-being-linked-i386/108193)

<div class="topic-metadata">

**Author:** [@Chaboi\_3000](https://meta.discourse.org/u/Chaboi_3000)\
**回覆:** 10\
**Last updated:** [2022年四月1日 02:36 UTC](https://meta.discourse.org/t/cant-start-localhost-server-file-was-built-for-x86-64-which-is-not-the-architecture-being-linked-i386/108193 "2022-04-01T02:36:49Z")

</div>

我使用的是 macOS，并遵循此指南：《MacOS 开发环境 Discourse 安装入门指南》。 执行到这一步：\`bundle exec rake db:create db:migrate RAILS\_ENV=test\` 和 \`bundle exec rake db:create db:migrate\`，返回了 t…

---

## [我的postgres在我的docker容器中无法启动](https://meta.discourse.org/t/my-postgres-isnt-starting-with-my-docker-container/222421)

<div class="topic-metadata">

**Author:** [@natasha\_selvidge](https://meta.discourse.org/u/natasha_selvidge)\
**回覆:** 5\
**Last updated:** [2022年三月29日 23:03 UTC](https://meta.discourse.org/t/my-postgres-isnt-starting-with-my-docker-container/222421 "2022-03-29T23:03:38Z")

</div>

引起： PG::ConnectionBad：连接到服务器套接字“/var/run/postgresql/.s.PGSQL.5432”失败：无此文件或目录 服务器是否在本地运行并接受该套接字的连接？

---

## [在主题的 main-outlet 的左侧和右侧添加元素](https://meta.discourse.org/t/adding-elements-to-the-left-and-right-side-of-main-outlet-in-a-theme/222134)

<div class="topic-metadata">

**Author:** [@piffy](https://meta.discourse.org/u/piffy)\
**回覆:** 3\
**Last updated:** [2022年三月28日 08:23 UTC](https://meta.discourse.org/t/adding-elements-to-the-left-and-right-side-of-main-outlet-in-a-theme/222134 "2022-03-28T08:23:53Z")

</div>

您好，我对 Discourse 使用的许多开发约定还不熟悉，因此我在这里寻求一些指导。 我基本上是想为我正在创建的主题的主插槽的四面都添加一个图像……

---

## [Discourse 网站路径 URL 重命名](https://meta.discourse.org/t/discourse-website-path-urls-rename/221636)

<div class="topic-metadata">

**Author:** [@Hemant\_Raju1](https://meta.discourse.org/u/Hemant_Raju1)\
**回覆:** 4\
**Last updated:** [2022年三月22日 08:46 UTC](https://meta.discourse.org/t/discourse-website-path-urls-rename/221636 "2022-03-22T08:46:54Z")

</div>

我想重命名一些路径 URL 例如：http://localhost:4200/c/biotechnology/5/l/calendar 将 calendar 重命名为 events。 http://localhost:4200/agenda 将 agenda 重命名为 c…

---

## [将ItemLists中的结构化数据/微数据重构为“简单”的ListItem](https://meta.discourse.org/t/refactor-structured-data-microdata-in-itemlists-to-become-simple-listitem/220858)

<div class="topic-metadata">

**Author:** [@rrit](https://meta.discourse.org/u/rrit)\
**回覆:** 3\
**Last updated:** [2022年三月21日 17:08 UTC](https://meta.discourse.org/t/refactor-structured-data-microdata-in-itemlists-to-become-simple-listitem/220858 "2022-03-21T17:08:53Z")

</div>

Discourse 在多个位置使用带有 ListItem 的微数据 ItemList。 其中一些 ListItem 仅仅是对实际对象的引用/链接，它们本身并不代表一个对象。请参阅 ItemLists： Crawler-View：…

---

## [发送规范链接标头而不是noindex标头](https://meta.discourse.org/t/send-canonical-link-header-instead-of-noindex-header/220213)

<div class="topic-metadata">

**Author:** [@rrit](https://meta.discourse.org/u/rrit)\
**回覆:** 6\
**Last updated:** [2022年三月21日 00:14 UTC](https://meta.discourse.org/t/send-canonical-link-header-instead-of-noindex-header/220213 "2022-03-21T00:14:17Z")

</div>

发送规范链接标头而不是noindex标头。 发送规范标头与发送noindex标头在抓取预算方面可能具有相同的优势——而没有排除网址的SEO影响，这些网址……

---

## [Posts 结构化数据：作者 URL 被“noindex”阻止](https://meta.discourse.org/t/posts-structured-data-authors-url-is-blocked-by-noindex/221490)

<div class="topic-metadata">

**Author:** [@rrit](https://meta.discourse.org/u/rrit)\
**回覆:** 0\
**Last updated:** [2022年三月20日 17:53 UTC](https://meta.discourse.org/t/posts-structured-data-authors-url-is-blocked-by-noindex/221490 "2022-03-20T17:53:13Z")

</div>

在每个帖子的结构化数据中，都有一个指向作者页面的 URL：

---

## [帖子结构化数据：设置显式“标识符”和规范 URL 为“URL”](https://meta.discourse.org/t/posts-structured-data-set-explicit-identifier-and-canonical-url-as-url/221486)

<div class="topic-metadata">

**Author:** [@rrit](https://meta.discourse.org/u/rrit)\
**回覆:** 0\
**Last updated:** [2022年三月20日 15:59 UTC](https://meta.discourse.org/t/posts-structured-data-set-explicit-identifier-and-canonical-url-as-url/221486 "2022-03-20T15:59:54Z")

</div>

在结构化数据模型中： 帖子是主题页面上的对象，目前通过其 id-tag 进行标识。然后，页面的规范 URL 用于创建标识符——另请参阅： “identifier” 属性 - B⋯

---

## [更改 Ember-url 文章的规范链接标签以使用新的规范 URL](https://meta.discourse.org/t/change-canonical-link-tag-for-posts-ember-url-to-use-new-canonical-url/221480)

<div class="topic-metadata">

**Author:** [@rrit](https://meta.discourse.org/u/rrit)\
**回覆:** 0\
**Last updated:** [2022年三月20日 14:48 UTC](https://meta.discourse.org/t/change-canonical-link-tag-for-posts-ember-url-to-use-new-canonical-url/221480 "2022-03-20T14:48:57Z")

</div>

以下 PR 为帖子引入了新的规范 URL。我真的很感激！:tada: FEATURE: 在 posts.rss feed 中使用规范链接 by SamSaffron · Pull Request #16190 · discourse/discourse · GitHub 在 craw…

---

## [在欢迎链接横幅中使用 emoji 替代图标](https://meta.discourse.org/t/using-emojis-instead-of-icons-in-the-welcome-link-banner/270588)

<div class="topic-metadata">

**Author:** [@mk0r](https://meta.discourse.org/u/mk0r)\
**回覆:** 3\
**Last updated:** [2022年三月20日 12:37 UTC](https://meta.discourse.org/t/using-emojis-instead-of-icons-in-the-welcome-link-banner/270588 "2022-03-20T12:37:59Z")

</div>

\*\*问题：横幅颜色默认是否会遵循主题颜色（例如，论坛处于黑暗模式时）？ 另外，有两个功能请求： 如果能将对齐方式从居中改为左对齐，那就太好了 \*\*

---

## [插入以检查HTML标签的Discourse站点](https://meta.discourse.org/t/plug-in-to-check-html-tags-discourse-site/221345)

<div class="topic-metadata">

**Author:** [@hhlp](https://meta.discourse.org/u/hhlp)\
**回覆:** 2\
**Last updated:** [2022年三月19日 09:32 UTC](https://meta.discourse.org/t/plug-in-to-check-html-tags-discourse-site/221345 "2022-03-19T09:32:02Z")

</div>

Discourse 的 HTML 标签检查插件叫什么名字？我指的是在搜索、汉堡菜单和用户旁边启用画笔图标的插件，以便进行适当的调试，而不是使用浏览器检查器开发者工具……

---

## [Discourse 找不到插件中指定的 gem](https://meta.discourse.org/t/discourse-cant-find-gems-specified-in-the-plugin/219968)

<div class="topic-metadata">

**Author:** [@w4ll3](https://meta.discourse.org/u/w4ll3)\
**回覆:** 14\
**Last updated:** [2022年三月18日 06:09 UTC](https://meta.discourse.org/t/discourse-cant-find-gems-specified-in-the-plugin/219968 "2022-03-18T06:09:55Z")

</div>

你好！我正在开发一个插件，用于在 Discourse 上启用 Sign-In with Ethereum。问题是，在安装插件时，我遇到了一个关于依赖项 (rbsecp256k1) 的错误。 错误： 安装 rbsecp256k1 时出错……

---

## [通过 Discourse API 获取主题中的顶级帖子](https://meta.discourse.org/t/get-only-top-level-posts-in-topic-via-discourse-api/86319)

<div class="topic-metadata">

**Author:** [@coopaloop](https://meta.discourse.org/u/coopaloop)\
**回覆:** 4\
**Last updated:** [2022年三月17日 13:48 UTC](https://meta.discourse.org/t/get-only-top-level-posts-in-topic-via-discourse-api/86319 "2022-03-17T13:48:57Z")

</div>

我希望能够获取某个主题下最新的 20 条顶级帖子，而无需递归地重新获取并过滤帖子回复直到凑齐 20 条。是否有这样的筛选条件，只是我错过了吗…

---

## [根据自定义字段检索主题？](https://meta.discourse.org/t/retrieve-topics-based-on-custom-field/199879)

<div class="topic-metadata">

**Author:** [@JQ331](https://meta.discourse.org/u/JQ331)\
**回覆:** 12\
**Last updated:** [2022年三月17日 09:40 UTC](https://meta.discourse.org/t/retrieve-topics-based-on-custom-field/199879 "2022-03-17T09:40:23Z")

</div>

使用@angus非常有帮助的指南，我已经能够为主题和组添加自定义字段。 一旦您成功添加了自定义字段，是否有（有效率的）方法可以根据该自定义字段检索项目？ 例如……

---

## [如何抑制“自动关闭”警告，直到接近关闭日期？](https://meta.discourse.org/t/how-to-suppress-auto-close-warning-until-closer-to-close-date/221004)

<div class="topic-metadata">

**Author:** [@Laura\_S](https://meta.discourse.org/u/Laura_S)\
**回覆:** 4\
**Last updated:** [2022年三月16日 11:39 UTC](https://meta.discourse.org/t/how-to-suppress-auto-close-warning-until-closer-to-close-date/221004 "2022-03-16T11:39:52Z")

</div>

是否有办法可以抑制“自动关闭”警告，直到帖子更接近关闭日期，或者完全抑制它？ 我不想扼杀讨论，但我们也遇到过有人复活……

---

## [在生产环境的插件中安装 \`eth\` gem 时遇到困难](https://meta.discourse.org/t/having-a-hard-time-installing-eth-gem-in-a-plugin-in-production/217496)

<div class="topic-metadata">

**Author:** [@fzngagan](https://meta.discourse.org/u/fzngagan)\
**回覆:** 6\
**Last updated:** [2022年三月14日 07:12 UTC](https://meta.discourse.org/t/having-a-hard-time-installing-eth-gem-in-a-plugin-in-production/217496 "2022-03-14T07:12:28Z")

</div>

我必须在插件中安装 eth gem，但这样做非常困难。它依赖于许多其他 gem，其中一些具有本机扩展。如果您想尝试一下，这是依赖项列表。…

---

## [使用 Keycloak 进行 Discourse 单点登录](https://meta.discourse.org/t/discourse-with-keycloak-for-sso/152922)

<div class="topic-metadata">

**Author:** [@AAverin](https://meta.discourse.org/u/AAverin)\
**回覆:** 7\
**Last updated:** [2022年三月10日 21:36 UTC](https://meta.discourse.org/t/discourse-with-keycloak-for-sso/152922 "2022-03-10T21:36:58Z")

</div>

有没有一种方法可以将 Keycloak 设置为 Discourse 的认证提供商？我需要以单点登录（SSO）的方式实现，这样由 Keycloak 管理账户的用户可以自动获得访问权限并登录到 Discourse…

---

## [discourse 仓库中的多个 'discourse' javascript 包](https://meta.discourse.org/t/multiple-discourse-javascript-packages-in-discourse-repo/220365)

<div class="topic-metadata">

**Author:** [@ryantm](https://meta.discourse.org/u/ryantm)\
**回覆:** 1\
**Last updated:** [2022年三月8日 03:14 UTC](https://meta.discourse.org/t/multiple-discourse-javascript-packages-in-discourse-repo/220365 "2022-03-08T03:14:37Z")

</div>

我想了解 Discourse 仓库中 Javascript 项目的结构。我对 Javascript 开发不太熟悉，所以如果这是显而易见的问题，请原谅我，但似乎有两个名为……的项目

---

## [Categories.json 端点在粒度范围内不可用](https://meta.discourse.org/t/categories-json-endpoint-is-not-available-in-granular-scope/218080)

<div class="topic-metadata">

**Author:** [@priyambodo.w](https://meta.discourse.org/u/priyambodo.w)\
**回覆:** 3\
**Last updated:** [2022年三月4日 21:39 UTC](https://meta.discourse.org/t/categories-json-endpoint-is-not-available-in-granular-scope/218080 "2022-03-04T21:39:33Z")

</div>

您好 :wave: 正如标题所示，当我分配具有细粒度范围的新 API 密钥时，类别不属于权限列表。即使我检查了所有细粒度范围权限，也收到了 403。我不得不使用全局范围 w…

---

## [修改后的围栏渲染器在预览中可用，但在烘焙后不可用](https://meta.discourse.org/t/modified-fence-renderer-works-in-preview-but-not-in-cooked-post/219951)

<div class="topic-metadata">

**Author:** [@Bearbobs](https://meta.discourse.org/u/Bearbobs)\
**回覆:** 0\
**Last updated:** [2022年三月3日 12:41 UTC](https://meta.discourse.org/t/modified-fence-renderer-works-in-preview-but-not-in-cooked-post/219951 "2022-03-03T12:41:21Z")

</div>

嘿， 我正在开发一个插件，用于在任何帖子的围栏内返回JSON中的原始HTML 但实施中的问题是，它在预览模式下按预期工作，但在已发布的帖子中却不行 这是源代码：Git……

---

## [Cookie横幅阻止程序导致图标丢失](https://meta.discourse.org/t/missing-icons-due-to-cookie-banner-blocker/219813)

<div class="topic-metadata">

**Author:** [@Kaleigh\_Downing](https://meta.discourse.org/u/Kaleigh_Downing)\
**回覆:** 0\
**Last updated:** [2022年三月2日 10:27 UTC](https://meta.discourse.org/t/missing-icons-due-to-cookie-banner-blocker/219813 "2022-03-02T10:27:21Z")

</div>

我正在努力使我们的社区在 Cookie 方面符合 GDPR 要求，只有在接受后才会放置 Cookie。我们正在使用 HubSpot 的 Cookie 横幅/扫描器和阻止器来实现此目的，但有一些标准图标……

---

## [了解 discourse 的 rails/ember 结构](https://meta.discourse.org/t/trying-to-understand-rails-ember-structure-of-discourse/219530)

<div class="topic-metadata">

**Author:** [@VijayB](https://meta.discourse.org/u/VijayB)\
**回覆:** 2\
**Last updated:** [2022年二月28日 15:06 UTC](https://meta.discourse.org/t/trying-to-understand-rails-ember-structure-of-discourse/219530 "2022-02-28T15:06:57Z")

</div>

我是一名全新的开发者（刚开始学习rails），并且正在尝试扩展论坛。我想知道是否有关于入门和理解前端（ember）如何与后端（ra……）协同工作的教程。

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

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