vuepress-plugin-editfrontmatter

1.1.0 • Public • Published

文章必须在docs目录下,否则无法使用本插件

目录结构参考vuepress官网

.
├── docs
   ├── .vuepress (可选的)
      ├── components (可选的)
      ├── theme (可选的)
         └── Layout.vue
      ├── public (可选的)
      ├── styles (可选的)
         ├── index.styl
         └── palette.styl
      ├── templates (可选的, 谨慎配置)
         ├── dev.html
         └── ssr.html
      ├── config.js (可选的)
      └── enhanceApp.js (可选的)
    
   ├── README.md
   ├── guide
      └── README.md
   └── config.md
 
└── package.json

安装

npm i vuepress-plugin-editfrontmatter

or 

yarn add vuepress-plugin-editfrontmatter

使用

// .vuepress/config.js
module.exports = {

  plugins: [
    ['editfrontmatter'],
}

可选参数

// .vuepress/config.js
module.exports = {

  plugins: [
    ['editfrontmatter', {
      customFields:[{     
        //要增加的字段,每一个为一个对象
        fields: [
          {name: 'sidebar', value: false}
        ]
      }],
       //只对title为liyao的md文件添加字段,可以为frontmatter的任何字段,不写添加到所有md文件
      defaultMatchAttribute: 'title', // frontmatter属性
      attr: 'liyao'                   //  对应的值
      
      //要删除的frontmatter字段,数组形式
      fieldsToDelete: ['author', 'tags']
  }]

  ],

}

Package Sidebar

Install

npm i vuepress-plugin-editfrontmatter

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

5.1 kB

Total Files

3

Last publish

Collaborators

  • liyao520