# 我们可以拥有最短的分享链接吗？

**URL:** <https://meta.discourse.org/t/can-we-have-the-shortest-possible-links-for-sharing/186933>\
**Category:** Feature\
**Created:** [2021年四月15日 09:50 UTC](https://meta.discourse.org/t/can-we-have-the-shortest-possible-links-for-sharing/186933 "2021-04-15T09:50:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ym\_gg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ym_gg/32/213761_2.png) [@Ym\_gg](https://meta.discourse.org/u/Ym_gg)\
**Post date:** [2021年四月15日 09:50 UTC](https://meta.discourse.org/t/can-we-have-the-shortest-possible-links-for-sharing/186933/1 "2021-04-15T09:50:08Z")

</div>

抱歉我的英语不好 🤨 如果我有语法错误，请指出或纠正，谢谢！

通常我使用分享按钮，会得到这个链接：

```plaintext
https://hibot.top/t/topic/7?u=ym_gg

```

我觉得它可以更短一些。有时我不想统计邀请，所以不需要 “u” 参数：

```plaintext
https://hibot.top/t/topic/7

```

我还发现链接可以不带 “topic” 也能正常工作：

```plaintext
https://hibot.top/t/7

```

最后，浏览器会自动补全 https：

```plaintext
hibot.top/t/7

```

我认为分享按钮可以显示这样的链接，这个链接在我的 Discourse 中可以正常工作。我希望能够自动完成这一点。

但我没有找到关于分享链接的具体设置（可能是因为翻译问题？）。如果有针对此功能的设置，请告诉我在哪里。如果没有相关设置，希望未来能够实现。如果由于设计原因无法实现，也请告诉我原因，谢谢！

 ![image](https://global.discourse-cdn.com/meta/original/3X/3/1/31696c39c3ad078013de21469edafab1e32b7be7.png)

---

<div class="post-metadata">

**Author:** ![Ym\_gg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ym_gg/32/213761_2.png) [@Ym\_gg](https://meta.discourse.org/u/Ym_gg)\
**Post date:** [2021年四月16日 08:24 UTC](https://meta.discourse.org/t/can-we-have-the-shortest-possible-links-for-sharing/186933/3 "2021-04-16T08:24:42Z")

</div>

我在等有人来解决这个问题 🙃

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2021年四月19日 02:32 UTC](https://meta.discourse.org/t/can-we-have-the-shortest-possible-links-for-sharing/186933/4 "2021-04-19T02:32:51Z")

</div>

如果您需要更短的链接，可以手动编辑它，或者编写一个插件来强制缩短链接。

---

<div class="post-metadata">

**Author:** ![Ym\_gg](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ym_gg/32/213761_2.png) [@Ym\_gg](https://meta.discourse.org/u/Ym_gg)\
**Post date:** [2021年四月20日 04:19 UTC](https://meta.discourse.org/t/can-we-have-the-shortest-possible-links-for-sharing/186933/5 "2021-04-20T04:19:53Z")

</div>

如果将其缩短为“hibot.top/t/7”，会对访问产生什么影响？

---

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [2021年四月20日 07:34 UTC](https://meta.discourse.org/t/can-we-have-the-shortest-possible-links-for-sharing/186933/6 "2021-04-20T07:34:40Z")

</div>

缩短 URL 时，最佳做法是使用 `-` 作为 slug：

`https://hibot.top/t/-/765432`

这样可以避免服务器需要判断 `765432` 是否可能为主题标题。

---

<div class="post-metadata">

**Author:** ![cogdog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cogdog/32/116536_2.png) [@cogdog](https://meta.discourse.org/u/cogdog)\
**Post date:** [2022年十一月18日 17:53 UTC](https://meta.discourse.org/t/can-we-have-the-shortest-possible-links-for-sharing/186933/7 "2022-11-18T17:53:50Z")

</div>

我喜欢简洁的链接！我很想拥有这个功能，但我不知道如何创建插件来实现它。当然，我凭直觉就能做到，但我们的社区呢？我已经在我们的指南和帖子中写过了，甚至连我自己的同事都无法手动编辑。

也许我应该创建一个徽章 😉

我很感激知道_这一点_

> [@riking](#):
>
> 缩短网址的最佳方法是使用 `-` 作为 slug：
