Skip to content

Commit

Permalink
fix($plugin-blog): inconsistent paths of tag and category pages with …
Browse files Browse the repository at this point in the history
…index page (#1420)
  • Loading branch information
Coolyang authored and ulivz committed Mar 12, 2019
1 parent 9734a58 commit 5c0e62f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/@vuepress/plugin-blog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ module.exports = (options, ctx) => {
frontmatter: { layout: getLayout('Categories', 'Page') }
},
{
when: ({ regularPath }) => regularPath.startsWith('/category/'),
when: ({ regularPath }) => regularPath.startsWith(categoryIndexPageUrl),
frontmatter: { layout: getLayout('Category', 'Page') }
},
{
when: ({ regularPath }) => regularPath === tagIndexPageUrl,
frontmatter: { layout: getLayout('Tags', 'Page') }
},
{
when: ({ regularPath }) => regularPath.startsWith('/tag/'),
when: ({ regularPath }) => regularPath.startsWith(tagIndexPageUrl),
frontmatter: { layout: getLayout('Tag', 'Page') }
},
{
Expand Down Expand Up @@ -86,15 +86,14 @@ module.exports = (options, ctx) => {
if (key) {
if (!map[key]) {
map[key] = {}
map[key].path = `/${scope}/${key}.html`
map[key].path = `${scope}${key}.html`
map[key].pageKeys = []
}
map[key].pageKeys.push(pageKey)
}
}

const handleTag = curryHandler('tag', tagMap)
const handleCategory = curryHandler('category', categoryMap)
const handleTag = curryHandler(tagIndexPageUrl, tagMap)
const handleCategory = curryHandler(categoryIndexPageUrl, categoryMap)

pages.forEach(({
key,
Expand Down

0 comments on commit 5c0e62f

Please sign in to comment.