Skip to content

Commit 8b46fd2

Browse files
committed
directory-level configuration
1 parent f34b152 commit 8b46fd2

File tree

1 file changed

+28
-37
lines changed

1 file changed

+28
-37
lines changed

rfcs/001.blog-plugin.md

Lines changed: 28 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
# Summary
66

7-
- a new `@vuepress/plugin-blog`, featured with tags, categories, drafting, pagination
8-
- a `@vuepress/theme-plog`
7+
- `@vuepress/plugin-blog`, featured with tags, categories, drafting, pagination
8+
- `@vuepress/theme-plog`, featured with
99

1010
# Basic example
1111

1212
See [detailed design](#detailed-design) section.
1313

1414
# Motivation
1515

16-
By popular demand, VuePress will provide some official blog supports, including a blog plugin and an atomic blog theme.
16+
With popular demand, VuePress will provide some official blog supports, including a blog plugin and an atomic blog theme.
1717

1818
See: [#36](https://github.com/vuejs/vuepress/issues/36)
1919

@@ -33,8 +33,8 @@ module.exports = {
3333
postsSorter(postA, postB) {
3434
// default: Array.prototype.sort
3535
},
36-
perPagePosts: 10,
37-
layout: 'Layout',
36+
postsPerPage: 10,
37+
layout: 'Pagination',
3838
},
3939
}
4040
}
@@ -69,24 +69,6 @@ And there are pages automatically generated:
6969
- /categories/
7070
- /categories/cat/
7171

72-
### specify via config
73-
74-
```js
75-
module.exports = {
76-
themeConfig: {
77-
directories: [
78-
{
79-
path: 'dog',
80-
category: 'dog',
81-
layout: 'DogLayout',
82-
}
83-
]
84-
}
85-
}
86-
```
87-
88-
### prev/next pages
89-
9072
If a post has its category, its previous/next page will be posts next to it under the same category.
9173

9274
## Drafting
@@ -97,20 +79,7 @@ draft: true
9779
---
9880
```
9981

100-
And this page will only be rendered with dev mode. Drafting can also be specified via config:
101-
102-
```js
103-
module.exports = {
104-
themeConfig: {
105-
directories: [
106-
{
107-
path: '_draft',
108-
draft: true,
109-
}
110-
]
111-
}
112-
}
113-
```
82+
And this page will only be rendered with dev mode.
11483

11584
## Authoring
11685

@@ -148,6 +117,28 @@ And there are pages automatically generated if there are more than one authors:
148117
- /authors/
149118
- /authors/Shigma/
150119

120+
## Directory-level Configuration
121+
122+
Drafting can also be specified via config:
123+
124+
```js
125+
module.exports = {
126+
themeConfig: {
127+
directories: [
128+
{
129+
path: '_draft',
130+
draft: true,
131+
},
132+
{
133+
path: 'cat',
134+
category: 'cat',
135+
layout: 'CatLayout',
136+
},
137+
]
138+
}
139+
}
140+
```
141+
151142
# Drawbacks
152143

153144
N/A

0 commit comments

Comments
 (0)