@motorjs/plugin-contentful
v3.3.3
Published
motor engine
Downloads
3
Readme
Motor plugin-contentful
Installation
using yarn
yarn add @motorjs/plugin-contentful
using npm
npm i -S @motorjs/plugin-contentful
Usage
const motor = require('@motorjs/engine')
const Contentful = require('@motorjs/plugin-contentful')
const isDevMode = process.env.NODE_ENV === 'development'
const motorConfig = {
templatesDir : path.resolve('templates'),
outputDir : path.resolve('output'),
viewsDir : path.resolve('views'),
plugins: [
new Contentful({
config: {
space: process.env.SPACE_ID,
accessToken: process.env.ACCESS_TOKEN
host: isDevMode ? 'preview.contentful.com' : 'cdn.contentful.com',
include: 2 // level of children nodes to be included in contentful json (default is 1)
},
mode: isDevMode ? 'filesystem' : 'generator',
contentType: 'landingPage',
singleTemplate: 'lorem-ipsum' // template to be used (optional, needed only for single microsites not included in marketing landing pages system)
})
// other plugins
]
}
motor(motorConfig)