2.0.0 • Published 7 years ago

gulp-pipe-metalcontentful v2.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

gulp-pipe-metalcontentful Circle CI npm version

Gulp pipeline for processing templates content managed by Contentful. This pipeline generates a single task, views, which does two things:

  1. Fetches and processes entries from the Contentful repo so the resulting data can be made useful to the templates
  2. Generates static views using Metalsmith.

Usage

import gulp from 'gulp';
import metalcontentful from 'gulp-pipe-metalcontentful';

metalcontentful.init(gulp, {
  src: 'app/views',
  dest: 'dest',
  contentful: {
    space: undefined,
    accessToken: undefined,
    host: undefined
  }
});
$ gulp views

API

init(gulp, options[, extendsDefaults])

gulp

Type: Object

Gulp instance.

options

Type: Object

Options that define the behavior of this task. This object is parsed by config() in gulp-task-helpers, so you can target specific NODE_ENV environments.

This object extends that of the configurables in gulp-task-metalsmith. The following are the extended properties of the object.

options.contentful

Type: Object Default:

{
  space: undefined,
  accessToken: undefined,
  host: undefined
}

Details required to access Contentful repo. See official package.

extendsDefaults

Type: boolean Default: true

Maps to useConcat param in config() of gulp-task-helpers.

Disclaimer

This is an experimental project driven by internal requirements.

License

This software is released under the MIT License.