# 我们可以更改分类的URL吗？

**URL:** https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401
**Category:** Support
**Created:** [2022年九月19日 12:37 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401 "2022-09-19T12:37:48Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![waqar](https://avatars.discourse-cdn.com/v4/letter/w/7993a0/32.png) [@waqar](https://meta.discourse.org/u/waqar)
#### Post date: [2022年九月19日 12:37 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/1 "2022-09-19T12:37:49Z")

</div>

您好，我们知道当我们在 Discourse 社区中添加某个类别时，其 URL 会显示为 [https://forum.dark-gaming.com/c/questions-support/10。在此类别中，“c”代表类别。](https://forum.dark-gaming.com/c/questions-support/10%E3%80%82%E5%9C%A8%E6%AD%A4%E7%B1%BB%E5%88%AB%E4%B8%AD%EF%BC%8C%E2%80%9Cc%E2%80%9D%E4%BB%A3%E8%A1%A8%E7%B1%BB%E5%88%AB%E3%80%82)

我的问题是，我们能否修改此默认 URL，以便用任何自定义单词或字母替换“c”？

---

<div class="post-metadata">

### Author: ![Alexander](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alexander/32/497634_2.png) [@Alexander](https://meta.discourse.org/u/Alexander)
#### Post date: [2022年九月19日 12:54 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/2 "2022-09-19T12:54:06Z")

</div>

也许可以通过修改 Discourse 源代码来实现，最初是这两个文件（但可能会破坏 Discourse）

> <https://github.com/discourse/discourse/blob/main/config/routes.rb>

[https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/routes/app-route-map.js](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/routes/app-route-map.js)

但你为什么要这样做？🤔

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2022年九月19日 13:04 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/3 "2022-09-19T13:04:51Z")

</div>

> [@Alexander](#):
>
> 修改 Discourse 源代码

这听起来是个非常糟糕的主意。

---

<div class="post-metadata">

### Author: ![waqar](https://avatars.discourse-cdn.com/v4/letter/w/7993a0/32.png) [@waqar](https://meta.discourse.org/u/waqar)
#### Post date: [2022年九月19日 15:00 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/4 "2022-09-19T15:00:36Z")

</div>

我们确实不应该冒这么大的风险。

---

<div class="post-metadata">

### Author: ![waqar](https://avatars.discourse-cdn.com/v4/letter/w/7993a0/32.png) [@waqar](https://meta.discourse.org/u/waqar)
#### Post date: [2022年九月19日 15:01 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/5 "2022-09-19T15:01:26Z")

</div>

@RGJ 你知道我们该如何改变吗？

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2022年九月19日 15:09 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/6 "2022-09-19T15:09:25Z")

</div>

您需要创建一个插件来覆盖 `/c` 路由。

我想知道，您为什么要更改此路由？

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2022年九月19日 16:28 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/7 "2022-09-19T16:28:48Z")

</div>

> [@RGJ](#):
>
> 这听起来是个非常糟糕的主意。

这是你应该听从的建议。

人类，除了市场部或管理层的那个人（他可能永远不会登录论坛）之外，注意不到网址。

---

<div class="post-metadata">

### Author: ![waqar](https://avatars.discourse-cdn.com/v4/letter/w/7993a0/32.png) [@waqar](https://meta.discourse.org/u/waqar)
#### Post date: [2022年九月20日 00:33 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/8 "2022-09-20T00:33:22Z")

</div>

我们将在我们的社区中提供不同类型的模拟面试服务，我的客户希望将“c”替换为“forum”，以使网址更易于理解。

哪个插件可以帮助更改此设置？

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [2022年九月20日 04:56 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/9 "2022-09-20T04:56:07Z")

</div>

> [@waqar](#):
>
> 哪个插件可以帮助我更改这个？

据我所知，目前还没有。你必须聘请一名开发人员，而且不能保证这样的插件会起作用。

这将相对增加很多成本，然后询问客户是否愿意为更改一个没有人看到或使用的词付费是完全可以接受的。

如果用户必须查看网址才能理解他在/她/它的位置，那么用户界面设计得非常糟糕。在 Discourse 上并非如此。

我不完全确定，但有没有可能你现在正在使用错误的工具？

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2022年九月20日 06:00 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/10 "2022-09-20T06:00:03Z")

</div>

选项 1：告诉您的客户这很昂贵  
选项 2：调整管理员 - 自定义 - 固定链接，将 /forum/whatever-your-client-wants 重定向到正确的类别

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [2022年九月20日 06:02 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/11 "2022-09-20T06:02:00Z")

</div>

> [@RGJ](#):
>
> 选项 2：tinker

有多少几率会破坏许多依赖于分类的功能？

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2022年九月20日 06:32 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/12 "2022-09-20T06:32:24Z")

</div>

这些赔率是零，但那是因为它一开始就不是一个完美的解决方案。所有永久链接只会添加一个_额外的_URL，该URL将重定向到实际的`/c/`类别URL。

优点是可以向客户展示它有效，缺点是浏览器中的URL实际上会更改为`/c/whatever`。

---

<div class="post-metadata">

### Author: ![waqar](https://avatars.discourse-cdn.com/v4/letter/w/7993a0/32.png) [@waqar](https://meta.discourse.org/u/waqar)
#### Post date: [2022年九月21日 14:11 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/13 "2022-09-21T14:11:30Z")

</div>

好的。我会和我的客户分享。

我还需要一个小小的帮助。在我的帖子中，我想使用 Discourse 帖子中的“隐藏详情”选项来折叠内容。

> **折叠详情**
>
> 我能够折叠内容，但如何将此选项的标题加粗？例如，我现在想将“折叠详情”加粗？

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2022年九月21日 16:03 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/14 "2022-09-21T16:03:46Z")

</div>

您可以使用 HTML

> **标题**
>
> 文本....

```plaintext
<details>
    <summary><b>标题</b></summary>
    <p>文本.... </p>
</details>

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2022年九月21日 20:39 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/15 "2022-09-21T20:39:37Z")

</div>

> [@waqar](#):
>
> 我想通过“隐藏详情”来折叠内容

点击扳手图标，它会插入相关内容：

 ![image](https://global.discourse-cdn.com/meta/original/4X/0/4/a/04a0b78c85db6fa7e692720a06763624b89dced4.png)

这会插入：

```plaintext
[details="摘要"]
此文本将被隐藏
[/details]

```

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [2022年九月21日 20:41 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/16 "2022-09-21T20:41:13Z")

</div>

你见过折叠的问题吗？

> [@waqar](#):
>
> 我能够折叠内容，但如何将此选项的标题加粗，例如，我现在想将“折叠详细信息”加粗？

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2022年九月21日 20:46 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/17 "2022-09-21T20:46:16Z")

</div>

> [@Moin](#):
>
> 你看到那个折叠的问题了吗？

哦。我猜可能没有？

我无法判断你是想在特定帖子的折叠详情标题内加粗内容，还是想让所有折叠详情的标题都加粗（这需要通过主题组件实现）。

HTML很麻烦，因为它混合了HTML和Markdown可能会变得混乱。

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [2022年九月21日 20:49 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/18 "2022-09-21T20:49:11Z")

</div>

我现在用的是 iPad，所以无法检查，但有没有什么 CSS 可以稍微调整一下？

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2022年九月21日 21:56 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/19 "2022-09-21T21:56:30Z")

</div>

问题不是已经回答过了……？ [Can we change the URL of categories? - #14 by Moin](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/14)

@pfaffman 你需要展开才能看到实际问题

> [@waqar](#):
>
> 我能够折叠内容，但如何将此选项的标题加粗，例如，我现在想将“折叠详细信息”加粗？

---

<div class="post-metadata">

### Author: ![waqar](https://avatars.discourse-cdn.com/v4/letter/w/7993a0/32.png) [@waqar](https://meta.discourse.org/u/waqar)
#### Post date: [2022年九月22日 00:22 UTC](https://meta.discourse.org/t/can-we-change-the-url-of-categories/239401/20 "2022-09-22T00:22:04Z")

</div>

您好，主要问题是关于网址的，但在查看回复并与客户讨论后，我们认为这成本太高且风险太大。

在同一个问题中，我曾请求关于“隐藏详情”选项的小帮助。
