Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>auto-front-matterNew to Visual Studio Code? Get it now.

auto-front-matter

CondorHero

|
55 installs
| (0) | Free
Automatic Front Matter for Markdown
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

auto-front-matter

auto-front-matter

Automatically insert lastmod/duration in front-matter when you save an md file,and VS Code >= 1.7.3

features

  1. Automatically insert lastmod and duration when saving the md file.
  2. Create an md file according to the template and use the VS Code command panel.
Windows: ⇧+ctrl+P
Mac: ⇧+⌘+P

⇧+⌘+P

Installation

You can get the extension via:

  • The VS Code marketplace: VS Code Marketplace - Auto Front Matter.
  • The extension CLI: ext install condorhero.auto-front-matter

Usage

demo

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 insert lastmod in front-matter, default true.
  • insertReadTime: Whether to insert duration in front-matter, default true.
  • newFileIsInsertLastMod: Whether to insert lastmod in front-matter for uncommitted file, default false.
  • newFileIsInsertReadTime: Whether to insert duration in front-matter for uncommitted file, default false.
  • wordsPerMinute: words per minute, default 500.
  • template: Creating Markdown file depends on this template, default GET_DEFAULT_FRONT_MATTER.
export const GET_DEFAULT_FRONT_MATTER = () => {
	return {
		data: {
			date: new Date(new Date().toISOString()),
			author: "CondorHero",
			tags: ["hello", "world"],
			categories: "blog",
		},
		content: "\n# Hello World!\n",
	};
};

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft