Repository navigation
Mkdocs material 使用自定义 slug 和 url #54
shenweiyan
announced in
2.2-好玩
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Mkdocs material 默认使用目录+文件名作为 post 展示的 URL,如果目录名/文件名太长的话,你的 URL 就会显得非常长。尤其是当你从浏览器地址栏中复制某一篇文档的链接时候,如果你的 URL 同时包含了中文,URL 转码后会导致你复制后粘贴的链接变得更加长。
Mkdocs material 目前我是没看到有什么具体的插件解决这个问题,只不过有人在 squidfunk/mkdocs-material#5161 基于 hook 提供了一个解决的方案。这个方案基本上能满足我们的需求,但也有一些限制。
/作为开头,且必须以/作为结尾。All reactions