https://github.com/zentered/frontformatter
Bulk transform markdown frontmatter
https://github.com/zentered/frontformatter
jamstack static-site webdev
Last synced: 5 months ago
JSON representation
Bulk transform markdown frontmatter
- Host: GitHub
- URL: https://github.com/zentered/frontformatter
- Owner: zentered
- License: mit
- Created: 2020-09-25T16:43:45.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-06-13T23:49:23.000Z (about 1 year ago)
- Last Synced: 2025-02-07T05:44:08.057Z (5 months ago)
- Topics: jamstack, static-site, webdev
- Language: JavaScript
- Homepage:
- Size: 1.14 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README


[](https://www.npmjs.org/package/frontformatter)# Front Formatter
If you work with [hugo](https://gohugo.io), [11ty](https://www.11ty.dev) or any other static site generator, you'll likely end up with a lot of Markdown files after a while.
This script helps to migrate, add or remove properties from Markdwon frontmatter.
## Usage
Specify a source folder or copy your markdown files into `src`. You can define properties to add and remove, then run the transformation function:
const frontformatter = require('./frontformatter')
const addProperties = {
add: 'this'
}
const removeProperties = ['remove']const markdownOptions = {
resultVersion: 3,
'first-line-heading': 2,
'no-empty-links': true
}frontformatter('src', addProperties, removeProperties, markdownOptions)
## Acknowledgments
Thanks to [Jon Schlinkert](https://github.com/jonschlinkert) for [gray-matter](https://github.com/jonschlinkert/gray-matter)
## Licence
Licensed under [MIT](./LICENSE).