Skip to content

Commit 15ccee3

Browse files
committed
docs: @vuepress/plugin-pagination
1 parent 83cdc8b commit 15ccee3

File tree

4 files changed

+81
-29
lines changed

4 files changed

+81
-29
lines changed

packages/@vuepress/plugin-pagination/README.md

-29
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,3 @@
22

33
> pagination plugin for vuepress
44
5-
## Usage
6-
7-
```javascript
8-
module.exports = {
9-
plugins: ['@vuepress/pagination']
10-
}
11-
```
12-
13-
## postsFilter
14-
15-
- Type: `function`
16-
- Default:
17-
18-
```js
19-
(({ type }) => type === 'post')`
20-
```
21-
22-
## postsSorter
23-
24-
- Type: `function`
25-
- Default:
26-
27-
```js
28-
((prev, next) => {
29-
const prevTime = new Date(prev.frontmatter.date).getTime()
30-
const nextTime = new Date(next.frontmatter.date).getTime()
31-
return prevTime - nextTime > 0 ? -1 : 1
32-
})
33-
```

packages/docs/docs/.vuepress/config.js

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ function getPluginSidebar (pluginTitle, pluginIntro, officialPluginTitle) {
129129
'official/plugin-search',
130130
'official/plugin-pwa',
131131
'official/plugin-blog',
132+
'official/plugin-pagination',
132133
]
133134
}
134135
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# @vuepress/plugin-pagination
2+
3+
> pagination plugin for vuepress
4+
5+
## Install
6+
7+
```bash
8+
yarn add -D @vuepress/plugin-pagination
9+
# OR npm install -D @vuepress/plugin-pagination
10+
```
11+
12+
## Usage
13+
14+
```javascript
15+
module.exports = {
16+
plugins: ['@vuepress/pagination']
17+
}
18+
```
19+
20+
## postsFilter
21+
22+
- Type: `function`
23+
- Default:
24+
25+
```js
26+
(({ type }) => type === 'post')`
27+
```
28+
29+
## postsSorter
30+
31+
- Type: `function`
32+
- Default:
33+
34+
```js
35+
((prev, next) => {
36+
const prevTime = new Date(prev.frontmatter.date).getTime()
37+
const nextTime = new Date(next.frontmatter.date).getTime()
38+
return prevTime - nextTime > 0 ? -1 : 1
39+
})
40+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# @vuepress/plugin-pagination
2+
3+
> pagination plugin for vuepress
4+
5+
## Install
6+
7+
```bash
8+
yarn add -D @vuepress/plugin-pagination
9+
# OR npm install -D @vuepress/plugin-pagination
10+
```
11+
12+
## Usage
13+
14+
```javascript
15+
module.exports = {
16+
plugins: ['@vuepress/pagination']
17+
}
18+
```
19+
20+
## postsFilter
21+
22+
- Type: `function`
23+
- Default:
24+
25+
```js
26+
(({ type }) => type === 'post')`
27+
```
28+
29+
## postsSorter
30+
31+
- Type: `function`
32+
- Default:
33+
34+
```js
35+
((prev, next) => {
36+
const prevTime = new Date(prev.frontmatter.date).getTime()
37+
const nextTime = new Date(next.frontmatter.date).getTime()
38+
return prevTime - nextTime > 0 ? -1 : 1
39+
})
40+
```

0 commit comments

Comments
 (0)