Harp2hugo
Gem for converting posts from Harp metadata json into Hugo Front Matter format.
Used in https://www.yunspace.com/
Usage
$ gem install harp2hugo
$ harp2hugo [input_file] [output_dir]
Where input_file defaults to _data.json
and output_dir defaults to output
.
NOTE: the output dir will be created relative to your input file directory.
$ harp2hugo public/posts/_data.json output
Logic is to loop through each post specified in _data.json
file:
- Reads in the metadata in JSON format
- Convert metadata to YAML format and prepend to the post
- Write the new post with prepended metadata into output directory.
Disclaimer
Currently still work in progress. Written with plenty of help from @nagliyvred
Contributing
- Fork it ( https://github.com/yunspace/harp2hugo/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request