-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.js
74 lines (62 loc) · 1.51 KB
/
index.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
var Metalsmith = require('metalsmith');
var serve = require('metalsmith-serve');
var watch = require('metalsmith-watch');
var layouts = require('metalsmith-layouts');
var sass = require('metalsmith-sass');
var collections = require('metalsmith-collections');
var addmeta = require('metalsmith-collections-addmeta');
var markdown = require('metalsmith-markdown');
var drafts = require('metalsmith-drafts');
var partials = require('metalsmith-discover-partials');
// TODO only use serve in dev
Metalsmith(__dirname)
.metadata({
site: {
title: 'live:js',
description: 'Audio visual browser awesome',
generator: 'Metalsmith',
url: 'http://livejs.network/'
}
})
.source('./src')
.destination('./docs')
.clean(true) // rebuild everything
.use(sass({
outputDir: 'assets/', // This changes the output dir to 'build/assets/'
sourceMap: true
}))
.use(partials({
directory: './layouts/partials/',
pattern: /\.hbs$/
}))
.use(drafts())
.use(markdown())
.use(collections({
biography: {
pattern: 'biographies/*.md',
sortBy: 'order',
},
blog: {
pattern: 'blog/*.md',
sortBy: 'date',
reverse: true
}
}))
// .use(addmeta({
// biography: {
// layout: 'biography-item.hbs'
// }
// }))
.use(layouts('handlebars'))
.use(serve())
.use(
watch({
paths: {
'${source}/**/*': true,
'layouts/**/*': true,
}
})
)
.build(function(err, files) {
if (err) { throw err; }
});