From 41e45906303ab8d21e55c68ccb7ffcb2029bbee5 Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Fri, 2 Nov 2018 11:48:27 +0800 Subject: [PATCH] docs: @vuepress/plugin-last-updated --- .../@vuepress/plugin-last-updated/README.md | 31 -------------- packages/docs/docs/.vuepress/config.js | 1 + .../plugin/official/plugin-last-updated.md | 42 +++++++++++++++++++ .../zh/plugin/official/plugin-last-updated.md | 42 +++++++++++++++++++ 4 files changed, 85 insertions(+), 31 deletions(-) create mode 100644 packages/docs/docs/plugin/official/plugin-last-updated.md create mode 100644 packages/docs/docs/zh/plugin/official/plugin-last-updated.md diff --git a/packages/@vuepress/plugin-last-updated/README.md b/packages/@vuepress/plugin-last-updated/README.md index 6211bf5572..9c85db7390 100644 --- a/packages/@vuepress/plugin-last-updated/README.md +++ b/packages/@vuepress/plugin-last-updated/README.md @@ -2,34 +2,3 @@ > last-updated plugin for vuepress -> Note that this plugin has been included in the core. - -## 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 } - ] - ] -} -``` diff --git a/packages/docs/docs/.vuepress/config.js b/packages/docs/docs/.vuepress/config.js index 746c5c9109..457c78a192 100644 --- a/packages/docs/docs/.vuepress/config.js +++ b/packages/docs/docs/.vuepress/config.js @@ -132,6 +132,7 @@ function getPluginSidebar (pluginTitle, pluginIntro, officialPluginTitle) { 'official/plugin-pagination', 'official/plugin-google-analytics', 'official/plugin-i18n-ui', + 'official/plugin-last-updated', ] } ] diff --git a/packages/docs/docs/plugin/official/plugin-last-updated.md b/packages/docs/docs/plugin/official/plugin-last-updated.md new file mode 100644 index 0000000000..d89a75acde --- /dev/null +++ b/packages/docs/docs/plugin/official/plugin-last-updated.md @@ -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 } + ] + ] +} +``` diff --git a/packages/docs/docs/zh/plugin/official/plugin-last-updated.md b/packages/docs/docs/zh/plugin/official/plugin-last-updated.md new file mode 100644 index 0000000000..d89a75acde --- /dev/null +++ b/packages/docs/docs/zh/plugin/official/plugin-last-updated.md @@ -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 } + ] + ] +} +```