使用不带帖子编号的网址导航时无法返回

我刚意识到,在不带帖子编号的情况下点击链接后,我无法返回到原始主题。举例说明:

https://meta.discourse.org/t/welcome-to-meta-discourse-org/1

https://meta.discourse.org/t/welcome-to-meta-discourse-org/

这是一个 bug,还是设计上就不支持?

1 个赞

I would say this is an edge case, it was reported before.

Our ember router and discourse server router are in slight disagreement about what to do here.

Relying on slug that is ever changing for routing a topic is super fragile anyway. If we rename “welcome to meta discourse org” to “welcome to meta discourse” this would all break spectacularly anyway.

Don’t remove the topic id if you need stable links is the lesson. The topic id in that case is 1, it is not a post id or number.

2 个赞

好的,谢谢!所以如果我想让内部来回工作,我实际上需要同时保留 slug 和 id 吗?因为只使用 id 似乎不起作用:https://meta.discourse.org/t/1

1 个赞

Yes please, keep the slug and the id:

For example https://meta.discourse.org/t/cant-navigate-back-when-using-urls-without-post-number/197060

That way the link will remain stable. Also this will work but it is not as pretty imo and will cause a redirect.

https://meta.discourse.org/t/-/197060

2 个赞

好的,所以我只需要任何 slug 和正确的 id,就像 t/welcome/1 一样。
感谢您的澄清 :ok_hand:

2 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.