提交 9581756a 编写于 作者: D DCloud_LXH

chore: createSidebar

上级 2c96c622
...@@ -37,24 +37,23 @@ function parseBar(file, options) { ...@@ -37,24 +37,23 @@ function parseBar(file, options) {
break; break;
} }
}) })
if (!hasComment) {
if (link && !isExternal(link)) {
link = path.join('/', link.replace(/\.md\b/, '')
.replace(/\bREADME\b/, '')
.replace(/\/index/, '/')
.replace(/\?id=/, '#'))
.replace(/\\/g, '/')
links.push(link) if (link && !isExternal(link)) {
} link = path.join('/', link.replace(/\.md\b/, '')
.replace(/\bREADME\b/, '')
.replace(/\/index/, '/')
.replace(/\?id=/, '#'))
.replace(/\\/g, '/')
contents.push({ links.push(link)
level: token.level,
[textName]: text,
[linkName]: link,
...config
})
} }
contents.push({
level: token.level,
[textName]: text,
[linkName]: link,
...config
})
} }
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册