Gulp plugin to fully parse and process a standard Stratic header:
- Validate the header
- Extract metadata
- Strip out the header
This module is deprecated. It turns out that the Stratic header just isn't expressive enough and is there for no good reason, really.
You should use gulp-grey-matter to parse YAML frontmatter instead. Accordingly, this package is unmaintained.
npm install stratic-parse-header
gulpfile.js
:
var gulp = require('gulp')
var straticParseHeader = require('stratic-parse-header');
gulp.task('parse', function() {
gulp.src('*.md')
.pipe(straticParseHeader());
});
Any Gulp plugin downstream of the call to straticParseHeader()
may now consume Stratic metadata. See METADATA.
Metadata is represented as properties on the Vinyl object:
title
(String
) — the title of the blog post
author
(String
) — the author of the blog post
time
(Object
) — the time the blog post was published
categories
(Array
) — the categories the blog post was published in
Contains two values that represent the time the blog post was published:
epoch
(Number
) — the time the blog post was published represented as seconds since the epoch
utcoffset
(String
) — the timezone the post was published in, represented as a UTC offset of the form UTC-N
or UTC+N
, where N
is an integer.
The localtime value of when the post was published may be retrieved by combining these values.
LGPL 3.0+
Alex Jordan [email protected]