Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 5a34e26

Browse files
committed
fix: require modifyBlogPluginOptions to delete the archive classifier
1 parent b8c8ca5 commit 5a34e26

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

example/.vuepress/config.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@ module.exports = {
33
description: 'This is a blog example built by VuePress',
44
theme: require.resolve('../../'),
55
themeConfig: {
6-
/**
7-
* Ref: https://vuepress-theme-blog.ulivz.com/#modifyblogpluginoptions
8-
* Workaround of https://github.com/ulivz/vuepress-plugin-blog/issues/1
9-
*/
10-
modifyBlogPluginOptions(blogPlugnOptions) {
11-
const archiveDirectoryClassifierIndex = blogPlugnOptions.directories.findIndex(d => d.id === 'archive')
12-
blogPlugnOptions.directories.splice(archiveDirectoryClassifierIndex, 1)
13-
return blogPlugnOptions
14-
},
156
/**
167
* Ref: https://vuepress-theme-blog.ulivz.com/#nav
178
*/

index.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,6 @@ module.exports = (themeConfig, ctx) => {
2424
lengthPerPage: 5,
2525
},
2626
},
27-
{
28-
id: 'archive',
29-
dirname: '_archive',
30-
path: '/archive/',
31-
// layout: 'IndexArchive', defaults to `Layout.vue`
32-
itemLayout: 'Post',
33-
itemPermalink: '/archive/:year/:month/:day/:slug',
34-
pagination: {
35-
lengthPerPage: 5,
36-
},
37-
},
3827
],
3928
frontmatters: [
4029
{
@@ -54,7 +43,7 @@ module.exports = (themeConfig, ctx) => {
5443

5544
const blogPluginOptions = typeof modifyBlogPluginOptions === 'function'
5645
? modifyBlogPluginOptions(defaultBlogPluginOptions)
57-
: themeConfig
46+
: defaultBlogPluginOptions
5847

5948
const plugins = [
6049
'@vuepress/plugin-nprogress',

0 commit comments

Comments
 (0)