提交 008c9013 编写于 作者: D DCloud_LXH

feat: create sitemap

上级 6258d917
......@@ -46,7 +46,7 @@ function parseBar(tab, file, options) {
}
}
link = path.join('/', link.replace(/\.md\b/, '.html')
link = path.join('/', link.replace(/\.md\b/, '')
.replace(/\bREADME\b/, '')
.replace(/\/index/, '/')
.replace(/\?id=/, '#'))
......
......@@ -9,6 +9,7 @@ const xmlAfter = `\n</urlset>`
module.exports = (links, callback = () => { }) => {
const xmlItems = links.map(url => {
if (!url.endsWith('/') && !url.endsWith('html')) url += '.html'
return ` <url>
<loc>${domain + url}</loc>
</url>`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册