-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
85 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# @vuepress/plugin-last-updated | ||
|
||
> last-updated plugin for vuepress | ||
> Note that this plugin has been included in the core. | ||
## Install | ||
|
||
```bash | ||
yarn add -D @vuepress/plugin-pagination | ||
# OR npm install -D @vuepress/plugin-pagination | ||
``` | ||
|
||
## Usage | ||
|
||
```js | ||
module.exports = { | ||
plugins: ['@vuepress/last-updated'] | ||
} | ||
``` | ||
|
||
## Options | ||
|
||
### transformer | ||
|
||
- Type: `function` | ||
- Default: `undefined` | ||
|
||
By default, this plugin produces a 13-bit timestamp for each page, you can also pass in a transformer to convert it to any format that you want. | ||
|
||
``` javascript | ||
const timeago = require("timeago.js"); | ||
|
||
module.exports = { | ||
plugins: [ | ||
[ | ||
'last-updated', | ||
{ transformer: timeago.format } | ||
] | ||
] | ||
} | ||
``` |
42 changes: 42 additions & 0 deletions
42
packages/docs/docs/zh/plugin/official/plugin-last-updated.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# @vuepress/plugin-last-updated | ||
|
||
> last-updated plugin for vuepress | ||
> Note that this plugin has been included in the core. | ||
## Install | ||
|
||
```bash | ||
yarn add -D @vuepress/plugin-pagination | ||
# OR npm install -D @vuepress/plugin-pagination | ||
``` | ||
|
||
## Usage | ||
|
||
```js | ||
module.exports = { | ||
plugins: ['@vuepress/last-updated'] | ||
} | ||
``` | ||
|
||
## Options | ||
|
||
### transformer | ||
|
||
- Type: `function` | ||
- Default: `undefined` | ||
|
||
By default, this plugin produces a 13-bit timestamp for each page, you can also pass in a transformer to convert it to any format that you want. | ||
|
||
``` javascript | ||
const timeago = require("timeago.js"); | ||
|
||
module.exports = { | ||
plugins: [ | ||
[ | ||
'last-updated', | ||
{ transformer: timeago.format } | ||
] | ||
] | ||
} | ||
``` |