If you work with hugo, 11ty 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.
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)
Thanks to Jon Schlinkert for gray-matter
Licensed under MIT.