提交 577d20a3 编写于 作者: D DCloud_LXH

fix: 修复 .md 链接访问

上级 abdc404c
...@@ -68,9 +68,9 @@ const config = { ...@@ -68,9 +68,9 @@ const config = {
.end() .end()
.plugin('convert-header') .plugin('convert-header')
.use(headerPlugin) .use(headerPlugin)
}, .end()
extendMarkdown: md => { .plugin('normallize-link')
md.use(require('./markdown/normallizeLink')) .use(require('./markdown/normallizeLink'))
} }
} }
} }
......
...@@ -18,7 +18,7 @@ function normalizeLink(url) { ...@@ -18,7 +18,7 @@ function normalizeLink(url) {
module.exports = function (md) { module.exports = function (md) {
md.normalizeLink = (function (oldNormalizeLink) { md.normalizeLink = (function (oldNormalizeLink) {
return function (url) { return function (url) {
url = isExternal(url) ? url : normalizeLink(url) url = isExternal(url) ? url : normalizeLink(url).replace('.md', '')
return oldNormalizeLink.bind(this)(url) return oldNormalizeLink.bind(this)(url)
} }
})(md.normalizeLink) })(md.normalizeLink)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
}, },
"scripts": { "scripts": {
"dev": "vuepress dev docs", "dev": "vuepress dev docs",
"build": "vuepress build docs" "build": "vuepress build docs --no-cache"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册