Skip to content
This repository has been archived by the owner on Jan 1, 2018. It is now read-only.

[deprecated] Take a Vinyl file with Stratic post information and make its contents JSON describing the post

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

straticjs/stratic-post-to-json-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

DEPRECATED

This module is deprecated - its design is flawed so I've stopped maintaining it. Use gulp-attach-to-template instead.

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

About

[deprecated] Take a Vinyl file with Stratic post information and make its contents JSON describing the post

Topics

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Stars

Watchers

Forks

Packages

No packages published