Skip to content

Commit c15bdfc

Browse files
committedNov 25, 2018
docs($plugin-last-updated): tweaks
1 parent 8c6b069 commit c15bdfc

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed
 

Diff for: ‎packages/docs/docs/plugin/official/plugin-last-updated.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,19 @@ module.exports = {
2828

2929
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.
3030

31+
e.g.
32+
3133
``` javascript
3234
const moment = require('moment');
3335

3436
module.exports = {
3537
plugins: [
3638
[
37-
'last-updated',
38-
{
39+
'@vuepress/last-updated',
40+
{
3941
transformer: (timestamp, lang) => {
42+
// Don't forget to install moment yourself
43+
const moment = require('moment')
4044
moment.locale(lang)
4145
return moment(timestamp).fromNow()
4246
}

Diff for: ‎packages/docs/docs/zh/plugin/official/plugin-last-updated.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,19 @@ module.exports = {
2828

2929
默认情况下,本插件为每个页面生成一个 13 位的时间戳,你可以传入一个 transformer 将其转换为你想要的任何格式。
3030

31+
例子:
32+
3133
``` javascript
3234
const moment = require('moment');
3335

3436
module.exports = {
3537
plugins: [
3638
[
37-
'last-updated',
38-
{
39+
'@vuepress/last-updated',
40+
{
3941
transformer: (timestamp, lang) => {
42+
// 不要忘了安装 moment
43+
const moment = require('moment')
4044
moment.locale(lang)
4145
return moment(timestamp).fromNow()
4246
}

0 commit comments

Comments
 (0)