-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildsite.js
33 lines (29 loc) · 875 Bytes
/
buildsite.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var Metalsmith = require('metalsmith'),
helpers = require('metalsmith-register-helpers'),
clean = require('metalsmith-clean'),
markdown = require('metalsmith-markdown'),
templates = require('metalsmith-templates'),
dataMarkdown = require('metalsmith-data-markdown'),
contentful = require('contentful-metalsmith');
Metalsmith(__dirname)
.destination('./public/build')
.source('src')
.use(markdown())
.use(helpers({
directory: 'server/handlebars/helpers'
}))
.use(clean(true))
.use(contentful({
accessToken: '9c58df927542109a651d0193a7843ba16877d698b11896935565f3e336e8c20f'
}))
.use(templates({
engine: 'handlebars',
directory: 'templates'
}))
.use(dataMarkdown({
removeAttributeAfterwards: true
}))
.build(function (err) {
console.log('Building Site From Console');
if (err) console.log(err);
});