auto-front-matter
v0.0.6
Published
Automatic Front Matter for Markdown
Downloads
11
Maintainers
Readme
auto-front-matter
Automatic Front Matter for Markdown
features
auto-front-matter provides two commands: auto-front-matter watch
and auto-front-matter create
.
auto-front-matter watch
Automatically insert lastmod
and duration
when saving the md file.
auto-front-matter create
Installation
npm install -D auto-front-matter
A frontmatter.json
file is required in the project directory. The frontmatter.json
file supports the following fields:
dirname
: Specify the directory to be updated.using glob, default current directory.globOptions
: glob's options.insertLastMod
: Whether to insertlastmod
infront-matter
, defaulttrue
.insertReadTime
: Whether to insertduration
infront-matter
, defaulttrue
.newFileIsInsertLastMod
: Whether to insertlastmod
infront-matter
for uncommitted file, defaultfalse
.newFileIsInsertReadTime
: Whether to insertduration
infront-matter
for uncommitted file, defaultfalse
.wordsPerMinute
: words per minute, default500
.template
: Creating Markdown file depends on this template, default GET_DEFAULT_FRONT_MATTER.
export function GET_DEFAULT_FRONT_MATTER() {
return {
data: {
date: new Date(new Date().toISOString()),
author: "CondorHero",
tags: ["hello", "world"],
categories: "blog",
},
content: "\n# Hello World!\n",
};
}