1.0.2 • Published 8 years ago

gulp-postman v1.0.2

Weekly downloads
1
License
ISC
Repository
github
Last release
8 years ago

gulp-postman

gulp plugin for generating multiple articles.

install

from npm

npm install -D gulp-postman

usage

Multiply pug template with post parameters.

gulp.task('html', () => {
    const params = {
        hoge: {
            title: 'hoge title',
            tags: ['a', 'b'],
            body: 'body body body body...'
        },
        moge: {
            title: 'moge title',
            tags: [],
            body: 'body body body body...'
        }
    };

    gulp.src('pug/*.pug')
        .pipe(postman({
            postParams: params,
            template: 'pug/post.pug'
        }))
        .pipe(pug())
        .pipe(gulp.dest('htdocs'));
});

Running this task, and generating htdocs/hoge.html and htdocs.moge.html.

Multiply ejs template with markdown articles.

gulp.task 'html', ->
  gulp.src "ejs/*.ejs"
    .pipe postman
      markdown: "posts/*.md"
      template: "ejs/article.ejs"
    .pipe ejs()
    .pipe gulp.dest "htdocs"

Write markdown article by Frontmatter format.

---
title: moge title
tags:
  - a
  - b
---
body body body body...
1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago