This package has been deprecated

Author message:

the Stratic header is not expressive enough; use YAML frontmatter instead

stratic-parse-header

1.1.0 • Public • Published

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

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

Readme

Keywords

Package Sidebar

Install

npm i stratic-parse-header

Weekly Downloads

1

Version

1.1.0

License

LGPL-3.0+

Last publish

Collaborators

  • strugee