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

Latest commit

 

History

History
67 lines (39 loc) · 1.78 KB

README.md

File metadata and controls

67 lines (39 loc) · 1.78 KB

stratic-parse-header

Gulp plugin to fully parse and process a standard Stratic header:

  1. Validate the header
  2. Extract metadata
  3. Strip out the header

DEPRECATED

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.

Installation

npm install stratic-parse-header

Usage

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

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

The time object

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.

License

LGPL 3.0+

Author

Alex Jordan alex@strugee.net