-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
帖子链接用纯数字的可能性? #646
Labels
Comments
这个是论坛核心的代码,我不是很清楚,但只用数字也是可以访问的。 |
嗯,我知道可以访问。只是想着有没有办法从源头生成干净的链接。 这个问题不是特别重要。能办就办,办不了也无妨。我早已经跟 Flarum 反馈过了:flarum/framework#194 (comment) |
@yixuan 你觉得加这么一句会有问题吗?主要是看看各种可能的链接有哪些,以及 Flarum 自己有没有用 <script>
window.history.replaceState({}, "", window.location.href.replace(/(\/d\/[0-9]+)-[^/]+/, "$1"));
</script> 它可以插在“自定义 HTML 头”中。 |
这两天出去一趟,只能回来再砍 bug 了。如果有网的话可能可以稍微测试一下。 |
我简单试了一下,不行。Flarum 会以某种方式动态改写地址栏中的链接(我估计就是 document.addEventListener("DOMContentLoaded", function(event) {
}); 我估计需要动用插件之类的东西。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
例如是否可以做到
https://d.cosx.org/d/419222-catboost-boosting
->https://d.cosx.org/d/419222
。对中文论坛来说,带标题的链接通常没什么意义,如看到https://d.cosx.org/d/419200-r
也不会知道它是“第十届中国 R 会议(合肥)纪要”。当然,保底的办法是用 JS 重写
<a>
的 href 属性。就是略暗黑,而且加载更多帖子时候还得继续重写。The text was updated successfully, but these errors were encountered: