Metalsmith JSON to files plugin
Creates files from supplied JSON
A Metalsmith plugin that lets you generate files from JSON
.
Features
- Many
JSON
files can be located in one directory for processing - Filename is configurable and generated from
JSON
source file - Permalink style filenames make for pretty URLs
Installation
$ npm install metalsmith-json-to-files
Usage
Initialise plugin
var json_to_files = ; metalsmith;
Use plugin
---name: My Poststemplate: posts.hbsjson_files: source_file: posts filename_pattern: posts/:date-:fields.slug as_permalink: true template: post.hbs--- Take a look...
Any extra metadata within the json_files
object will be passed through to the files it generates as data.
Examples
See the metalsmith-json-to-files CLI example
License
GPL-2.0