vuepress-plugin-auto-front-matter

page auto-front-matter plugin for vuepress

Usage no npm install needed!

<script type="module">
  import vuepressPluginAutoFrontMatter from 'https://cdn.skypack.dev/vuepress-plugin-auto-front-matter';
</script>

README

vuepress-plugin-auto-front-matter

自动生成部分重复性的 Front Matter。

----
author:
title:
date:
summary:
description:
location:
----

Installation

yarn add -D vuepress-plugin-auto-front-matter
// or npm install vuepress-plugin-auto-front-matter -D

Usage

// .vuepress/config.js

module.exports = {
    plugins: [
      ['auto-front-matter'],
      // other plugins
    ]
}

// or
module.exports = {
    plugins: [
      ['auto-front-matter',{
        author: 'Artiely' // 默认的全局作者
        summary: '详情请查看', // 默认的全局说明
        summaryLength: 200  // 说明的长度
        location: 'Wuhan,China' // 默认的全局地址
      }],
      // other plugins
    ]
}

result

$page:{
  frontmatter:{
    title: "....",
    date: "2020-4-1",
    author: "Artiely",
    summary: "......",
    description: "......",
    location: "Wuhan,China",
    // ...
  }
}

demo

https://artiely.gitee.io