From c0921f98898604a0c81bf22aa839c52612b1c3d0 Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Wed, 31 Jan 2024 14:58:52 +0800 Subject: [PATCH] fix: restore createSidebar --- docs/.vuepress/markdown/createSidebar.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/.vuepress/markdown/createSidebar.js b/docs/.vuepress/markdown/createSidebar.js index d02dffba..10c5654f 100644 --- a/docs/.vuepress/markdown/createSidebar.js +++ b/docs/.vuepress/markdown/createSidebar.js @@ -46,15 +46,11 @@ function parseBar(tab, file, options) { } } - link = path.join( - '/', - link - .replace(/(\bREADME\.md\b)|(\bREADME(?!\.))/i, 'index.html') // README.md | README | readme.md | readme -> index.html - .replace(/(\bindex\.md\b)|(index(?!\.))/, 'index.html') // /index -> /index.html - .replace(/\.md\b/, '.html') // *.md -> *.html - .replace(/\?id=/, '#') // ?id= -> # - .replace(/\\/g, '/') // \ -> / - ) + link = path.join('/', link.replace(/\.md\b/, '') + .replace(/\bREADME\b/, '') + .replace(/\/index/, '/') + .replace(/\?id=/, '#')) + .replace(/\\/g, '/') links.push(link) } -- GitLab