Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zentered/frontformatter
Bulk transform markdown frontmatter
https://github.com/zentered/frontformatter
jamstack static-site webdev
Last synced: 2 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 (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-13T23:49:23.000Z (7 months ago)
- Last Synced: 2024-10-30T14:43:41.836Z (2 months ago)
- Topics: jamstack, static-site, webdev
- Language: JavaScript
- Homepage:
- Size: 1.14 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![Test](https://github.com/zentered/frontformatter/workflows/Test/badge.svg)
![Semantic Release](https://github.com/zentered/frontformatter/workflows/Semantic%20Release/badge.svg?branch=main)
[![view on npm](https://img.shields.io/npm/v/frontformatter.svg)](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).