Closed duktig666 closed 1 year ago
这个应该是vuepress的问题,vue-theme-reco是基于vuepress的。可以通过安装vuepress-plugin-permalink-pinyin来解决这个问题。
这个插件并不是特别好用,会出现其他的兼容性问题。我之前也遇到这个问题了,我的版本是1.6.10
@Eastboat @ChenSino
解决办法参看我之前写的这篇文章: https://www.duktig.cn/2022/01/21/%E5%9F%BA%E4%BA%8Evuepress%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2%E7%B3%BB%E7%BB%9F%E5%8F%8A%E4%BC%98%E5%8C%96%E8%BF%87%E7%A8%8B-%E6%8C%81%E7%BB%AD%E6%9B%B4%E6%96%B0/#_1-md%E6%96%87%E4%BB%B6%E5%90%8D%E6%9C%89%E4%B8%AD%E6%96%87%E4%B8%8D%E8%83%BD%E6%AD%A3%E5%B8%B8%E8%B7%AF%E7%94%B1%E8%B7%B3%E8%BD%AC
文末的 问题1
但是会有一个新的不好的地方是 链接太长了……
解决: 添加文件.vuepress/enhanceApp.js
export default (ctx) => { const routes = ctx.router.getRoutes() ctx.router.beforeEach((to, from, next) => { // 解决decode后反复重定向的问题 const route = routes.find((v) => v.regex.test(to.path)) // .html有重定向路由,无需特殊处理 if (/\.html$/.test(to.path)) { return next() } // 不特殊处理 非通配符的 没有重定向的路由 if (route && route.path !== '*' && !route.redirect) { return next() } // 解决中文标签/分类路由无法被正确加载的问题 if (decodeURIComponent(to.path) !== to.path) { return next( Object.assign({}, to, { path: decodeURIComponent(to.path), fullPath: decodeURIComponent(to.fullPath) }) ) } next() }) // 临时解决,防止内部调用钩子再处理 ctx.router.beforeEach = () => { return } }
Originally posted by @duktig666 in https://github.com/vuepress-reco/vuepress-theme-reco/issues/23#issuecomment-1079697743
收到。
默认转拼音太难受了,某些情况就是想显示中文
我的想法是能不能做成映射关系配置项,前端显示是“前端Front-end”,跳转是"front-end"。不在配置内的就按默认转拼音
这个插件并不是特别好用,会出现其他的兼容性问题。我之前也遇到这个问题了,我的版本是1.6.10
@Eastboat @ChenSino
解决办法参看我之前写的这篇文章: https://www.duktig.cn/2022/01/21/%E5%9F%BA%E4%BA%8Evuepress%E6%90%AD%E5%BB%BA%E5%8D%9A%E5%AE%A2%E7%B3%BB%E7%BB%9F%E5%8F%8A%E4%BC%98%E5%8C%96%E8%BF%87%E7%A8%8B-%E6%8C%81%E7%BB%AD%E6%9B%B4%E6%96%B0/#_1-md%E6%96%87%E4%BB%B6%E5%90%8D%E6%9C%89%E4%B8%AD%E6%96%87%E4%B8%8D%E8%83%BD%E6%AD%A3%E5%B8%B8%E8%B7%AF%E7%94%B1%E8%B7%B3%E8%BD%AC
文末的 问题1
但是会有一个新的不好的地方是 链接太长了……
解决: 添加文件.vuepress/enhanceApp.js
Originally posted by @duktig666 in https://github.com/vuepress-reco/vuepress-theme-reco/issues/23#issuecomment-1079697743