Remark plugin to enhance frontmatter in markdown files with common frontmatter files per directory and a few other derived attributes.
This package is a remark
plugin.
If you want to add some coomon frontmatter to all markdown files in a directory.
This package is ESM only.
In Node.js (version 12.20+, 14.14+, or 16.0+), install with npm
:
npm install remark-enhance-frontmatter
import remarkEnhanceFrontmatter from 'remark-enhance-frontmatter';
import remarkParse from 'remark-parse';
import { unified } from 'unified';
const processor = unified()
.use(remarkParse)
.use(remarkDirective)
.use(remarkEnhanceFrontmatter, { title: true });
Name of the file that defines the pre-defined exports, default: _components.ts
Resolve relative paths from the merged frontmatter file with respect to that file.
Add a title
field to the frontmatter. The title is the first top-level heading in the markdown file # Title
.
List of functions to transform the frontmatter.