Miracles sometimes occur,

but one has to work terribly for them.

人生除了眼前的苟且,还有未知的 bug 和看不懂的 code

Scroll

# vuepress-plugin-auto-front-matter

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

----
author:
title:
date:
summary:
description:
location:
----
1
2
3
4
5
6
7
8

# Installation

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

1
2
3

# Usage

// .vuepress/config.js

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

// or
module.exports = {
    plugins: [
      ['auto-front-matter',{
        author: 'psrheartache' // 默认的全局作者
        summary: '详情请查看', // 默认的全局说明
        summaryLength: 200  // 说明的长度
        location: 'Wuhan,China' // 默认的全局地址
      }],
      // other plugins
    ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

# result

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

1
2
3
4
5
6
7
8
9
10
11
12

# demo

https://psrheartache.gitee.io (opens new window)