Skip to content

Commit 5c0e62f

Browse files
Coolyangulivz
Coolyang
authored andcommittedMar 12, 2019
fix($plugin-blog): inconsistent paths of tag and category pages with index page (#1420)
1 parent 9734a58 commit 5c0e62f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed
 

‎packages/@vuepress/plugin-blog/index.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ module.exports = (options, ctx) => {
2020
frontmatter: { layout: getLayout('Categories', 'Page') }
2121
},
2222
{
23-
when: ({ regularPath }) => regularPath.startsWith('/category/'),
23+
when: ({ regularPath }) => regularPath.startsWith(categoryIndexPageUrl),
2424
frontmatter: { layout: getLayout('Category', 'Page') }
2525
},
2626
{
2727
when: ({ regularPath }) => regularPath === tagIndexPageUrl,
2828
frontmatter: { layout: getLayout('Tags', 'Page') }
2929
},
3030
{
31-
when: ({ regularPath }) => regularPath.startsWith('/tag/'),
31+
when: ({ regularPath }) => regularPath.startsWith(tagIndexPageUrl),
3232
frontmatter: { layout: getLayout('Tag', 'Page') }
3333
},
3434
{
@@ -86,15 +86,14 @@ module.exports = (options, ctx) => {
8686
if (key) {
8787
if (!map[key]) {
8888
map[key] = {}
89-
map[key].path = `/${scope}/${key}.html`
89+
map[key].path = `${scope}${key}.html`
9090
map[key].pageKeys = []
9191
}
9292
map[key].pageKeys.push(pageKey)
9393
}
9494
}
95-
96-
const handleTag = curryHandler('tag', tagMap)
97-
const handleCategory = curryHandler('category', categoryMap)
95+
const handleTag = curryHandler(tagIndexPageUrl, tagMap)
96+
const handleCategory = curryHandler(categoryIndexPageUrl, categoryMap)
9897

9998
pages.forEach(({
10099
key,

0 commit comments

Comments
 (0)
Please sign in to comment.