From 9a5167f748e1f9ea5b3a671bc97e274f67c7b632 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Fri, 8 Feb 2019 16:28:56 +0800 Subject: [PATCH] feat($core): enable .html suffix by default This change respects Yuque's convention --- docs/.vuepress/config.js | 2 +- lib/index.js | 2 +- lib/toc.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 06de63f..579b177 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -8,7 +8,7 @@ module.exports = { // repoUrl: 'https://www.yuque.com/ant-design/course', home: { actionText: 'Getting Started →', - actionLink: '/intro/', + actionLink: '/intro.html', heroImage: 'https://cdn.nlark.com/yuque/0/2019/png/242808/1549571925285-2372b0a0-0234-421c-a139-00ea16f1a106.png', footer: `Copyright © ULIVZ`, features: [ diff --git a/lib/index.js b/lib/index.js index 018ed10..42b3c47 100644 --- a/lib/index.js +++ b/lib/index.js @@ -140,7 +140,7 @@ module.exports = (opts, ctx) => { ? postContent : `# ${title} \n\n ${postContent}` - const permalink = `/${slug}/` + const permalink = `/${slug}.html` await ctx.addPage({ content, frontmatter, diff --git a/lib/toc.js b/lib/toc.js index 37608dc..716c7c7 100644 --- a/lib/toc.js +++ b/lib/toc.js @@ -120,7 +120,7 @@ function getLeaf({ title, slug }) { - return [`/${slug}/`, title] + return [`/${slug}.html`, title] } /** @@ -141,7 +141,7 @@ function getBranch({ children: [] } if (slug && slug !== '#') { - group.path = `/${slug}/` + group.path = `/${slug}.html` } return group }