This package has been deprecated

Author message:

this module's design is flawed so it's unmaintained; use gulp-attach-to-template instead

stratic-post-to-json-data

1.0.0 • Public • Published

stratic-post-to-json-data

Gulp plugin to take a Vinyl file with Stratic post information (for example, something that's been parsed with stratic-parse-header) and make the file contents JSON describing the post. This is particularly useful when paired with something like gulp-jade-template.

Installation

npm install stratic-post-to-json-data

Usage

gulpfile.js:

var gulp = require('gulp')
var straticParseHeader = require('stratic-parse-header');
var straticToJson = require('stratic-post-to-json-data');
 
gulp.task('parse', function() {
    gulp.src('*.md')
        .pipe(straticParseHeader())
        .pipe(straticToJson());
});

Each file's contents are now JSON containing the post Markdown and associated metadata (title, author, timestamp and categories).

JSON format

This plugin transforms file contents into a JSON object with the following properties:

text (String) - The post content (i.e. whatever the file's contents were before)

metadata (Object) — contains title, author, time and categories keys which are the same as in stratic-parse-header

License

LGPL 3.0+

Author

Alex Jordan alex@strugee.net

Readme

Keywords

Package Sidebar

Install

npm i stratic-post-to-json-data

Weekly Downloads

1

Version

1.0.0

License

LGPL-3.0+

Last publish

Collaborators

  • strugee