-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
44 lines (42 loc) · 967 Bytes
/
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
/*eslint-env node*/
'use strict';
var metalsmith = require('metalsmith');
var collections = require('metalsmith-collections');
var markdown = require('metalsmith-markdown');
var permalinks = require('metalsmith-permalinks');
var templates = require('metalsmith-templates');
var ignore = require('metalsmith-ignore');
var assets = require('metalsmith-assets');
metalsmith(__dirname)
.clean(false)
.use(ignore('.DS_Store'))
.use(collections({
'posts': {
'pattern': 'posts/*.md',
'sortBy': 'date',
'reverse': true
}
}))
.use(markdown())
.use(permalinks({
pattern: ':title'
}))
.use(templates({
engine: 'mustache',
default: 'post.mustache',
partials: {
header: 'header',
footer: 'footer'
}
}))
.use(assets({
source: './assets',
destination: './assets'
}))
.build(function (err) {
if (err) {
console.error(err);
} else {
console.log('Site Built');
}
});