-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
1.6.6 版本更新后,将路由更改为中文,点击文章链接无效,无法跳转详情页 #346
Comments
我也遇到一样的问题 |
@scrushy @ligang1628 最好还是使用英文命名吧,因为 vuepress 的路由跳转是基于 vue-router 的,可能是与其有关,建议还是英文命名,减少不必要的麻烦。 |
同样,文章采用中文命名后无法解析为静态地址。改为英文命名后就没有这个问题。 |
使用插件 当文件名含有中文时,对应页面无法跳转,可通过如下插件解决这个问题,这个插件会将中文路径转换为拼音路径 本地安装: npm install -D vuepress-plugin-permalink-pinyin 然后配置插件: module.exports = {
plugins: [
// 支持中文文件名
[
"permalink-pinyin",
{
lowercase: true, // Converted into lowercase, default: true
separator: "-", // Separator of the slug, default: '-'
},
],
]
} 效果: 会被插件转成拼音路径,访问如下地址
会发现中文路径已经被转成拼音了 |
👍 |
我也一样,文章或目录采用中文命名的就无法打开,在routes里看解析所有静态路由地址,发现文章或目录带中文路由信息里,有path 但没有对应的 components,而且还被redirect到一个中文被 encode 后的地址上。如果版本是 vuepress 1.2.0、@vuepress/core 1.3.1、vuepress-theme-reco 1.2.2 就啥问题都没有。 |
@wencwcoder 虽然 vuepress 的路由跳转是基于 vue-router 的,但这并不影响使用中文路径跳转,因为如果使用 vuepress 默认主题,就可以正常打开路径中带有中文的 md 文件了。 |
上面的转换插件可以一试 |
收到,谢谢大佬的插件!!Orz
***@***.***
Sender: wencwcoder
Send Time: 2021-08-19 17:36
Receiver: vuepress-reco/vuepress-theme-reco
cc: Kai; Comment
Subject: Re: [vuepress-reco/vuepress-theme-reco] 1.6.6 版本更新后,将路由更改为中文,点击文章链接无效,无法跳转详情页 (#346)
@wencwcoder 虽然 vuepress 的路由跳转是基于 vue-router 的,但这并不影响使用中文路径跳转,因为如果使用 vuepress 默认主题,就可以正常打开路径中带有中文的 md 文件了。
上面的转换插件可以一试
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
可以参考这个issue下的解决方案,添加一个router的钩子 https://github.com/vuepress-reco/vuepress-theme-reco/issues/395#issuecomment-1019087787 |
vuepress-plugin-permalink-pinyin 这个插件使用默认的永久链接模式可以,但是如果修改永久链接模式为如下时会失效: // 永久链接格式
permalink: "/:year/:month/:day/:slug", |
主题2.0已经完美解决这个问题,咱们可以关注一下主题 2.0,后期 1.0 将不再维护了。 |
主题2.0计划什么时候发稳定版呢? |
The text was updated successfully, but these errors were encountered: