forked from ucdd2016/book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.js
35 lines (34 loc) · 909 Bytes
/
build.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
34
35
var metalsmith = require('metalsmith')
var watch = require('metalsmith-watch')
var markdown = require('metalsmith-markdown')
// var markdown = require('./lib/markdown')
var layouts = require('metalsmith-layouts')
var branch = require('metalsmith-branch')
var rename = require('metalsmith-rename')
var inplace = require('metalsmith-in-place')
var _ = require('lodash')
metalsmith(__dirname)
.use(branch('**/*.md')
.use(markdown({
smartypants: true,
gfm: true,
tables: true,
langPrefix: ''
}))
.use(layouts({
engine: 'handlebars',
directory: 'templates'
}))
)
.use(rename([[/\.hbs$/, '.html']]))
.use(watch({
paths: {
"${source}/**/*": true,
"templates/**/*": "**/*.md",
},
livereload: true,
}))
.build(function(err) {
if (err) throw err;
console.log(err)
});