diff --git a/docs/.vuepress/markdown/createSidebar.js b/docs/.vuepress/markdown/createSidebar.js index d02dffba5544332ee3d0b1eedcea3bd5945c8b0c..10c5654f7ef759a3fef3f9bea082c5508f18c0a5 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) }