提交 2ed83531 编写于 作者: D DCloud_LXH

feat: sidebar 支持相对路径

上级 3b93fa8d
...@@ -40,10 +40,7 @@ function parseBar(tab, file, options) { ...@@ -40,10 +40,7 @@ function parseBar(tab, file, options) {
if (link && !isExternal(link)) { if (link && !isExternal(link)) {
if (!link.startsWith('/')) { if (!link.startsWith('/')) {
const linkFirstItem = link.split('/')[0] link = path.join(tab, link).replace(/\\/g, '/')
if (tab.indexOf(linkFirstItem) === -1) {
link = `${tab}${link}`
}
} }
link = path.join('/', link.replace(/\.md\b/, '') link = path.join('/', link.replace(/\.md\b/, '')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册