# SEO 标题分隔符

**URL:** <https://meta.discourse.org/t/seo-title-separator/155997>\
**Category:** Feature\
**Created:** [2020年六月26日 08:00 UTC](https://meta.discourse.org/t/seo-title-separator/155997 "2020-06-26T08:00:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![zcuric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zcuric/32/292837_2.png) [@zcuric](https://meta.discourse.org/u/zcuric)\
**Post date:** [2020年六月26日 08:00 UTC](https://meta.discourse.org/t/seo-title-separator/155997/1 "2020-06-26T08:00:50Z")

</div>

我提交了一个 PR，将增加更改标题分隔符的选项：

> <https://github.com/discourse/discourse/pull/9815>
>
> \### This PR
> \- \[x\] Adds \`document\_title\_separator\` setting to update the title s…eparator to enable different types of SEO titles, for example: \`Test Topic | Discourse\`. Defaults to \`" - "\`, as it was before. 
> \- \[x\] Adds locale option for this new option
> 
> Setting is an enum with list of separators inspired by \[Yoast SEO WP plugin\](https://yoast.com/wordpress/plugins/seo/). 
> 
> \#### Note about tests
> I've tried to write a meaningful test for this new option, but because the \`qunit\` creates it's own titles I coudn't verify in the test that this option applies. \`qunit\` titles are separated with commas, for example: \`Test Topic,Qunit Discourse Test\`.

该设置是一个枚举类型，提供了一系列分隔符选项，灵感来源于 [Yoast SEO WP 插件](https://yoast.com/wordpress/plugins/seo/)。

例如，您可以将分隔符设置为：  
`Discourse Meta | The Official Support Forum for Discourse`  
或  
`Discourse Meta < The Official Support Forum for Discourse`

目前，唯一的选项是 `-`。

我没有采用 `plugin` 方案，原因主要有几点，主要是在我看来，插件似乎无法实现所有这些更改。当然，我可能错了。

@sam @codinghorror

---

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [2020年六月26日 09:09 UTC](https://meta.discourse.org/t/seo-title-separator/155997/2 "2020-06-26T09:09:54Z")

</div>

真的不太确定这是否适合放在核心功能中。

这其实算不上 SEO“高级用户”的设置，只是个人偏好而已。

---

<div class="post-metadata">

**Author:** ![zcuric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zcuric/32/292837_2.png) [@zcuric](https://meta.discourse.org/u/zcuric)\
**Post date:** [2020年六月26日 09:16 UTC](https://meta.discourse.org/t/seo-title-separator/155997/3 "2020-06-26T09:16:26Z")

</div>

您可能是对的。

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2020年六月29日 00:53 UTC](https://meta.discourse.org/t/seo-title-separator/155997/4 "2020-06-29T00:53:53Z")

</div>

是的，我的观点是核心部分可以稍作清理，使其能够通过插件进行扩展，但我不想在核心中保留这个额外的选项。

---

<div class="post-metadata">

**Author:** ![zcuric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zcuric/32/292837_2.png) [@zcuric](https://meta.discourse.org/u/zcuric)\
**Post date:** [2020年六月29日 08:03 UTC](https://meta.discourse.org/t/seo-title-separator/155997/5 "2020-06-29T08:03:24Z")

</div>

关闭 PR。感谢反馈。
