-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.js
executable file
·61 lines (53 loc) · 1.25 KB
/
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
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
#!/usr/bin/env node
var Metalsmith = require('metalsmith'),
markdown = require('metalsmith-markdown-remarkable'),
layouts = require('metalsmith-layouts'),
sass = require('metalsmith-sass'),
collections = require('metalsmith-collections'),
permalinks = require('metalsmith-permalinks'),
metadata = require('metalsmith-metadata'),
fingerprint = require('metalsmith-fingerprint'),
minify = require('metalsmith-html-minifier'),
helpers = require('metalsmith-register-helpers');
Metalsmith(__dirname)
// Process CSS
.use(sass({
outputStyle: 'compressed',
includePaths: ['bower_components/']
}))
.use(fingerprint({
pattern: ['styles/style.css']
}))
// Process Metadata
.use(metadata({
endorsements: "content/endorsements.json"
}))
.use(collections({
pages: {
pattern: 'content/pages/*.md'
}
}))
// Process Markdown
.use(markdown({
html: true,
typographer: true,
}))
.use(permalinks({
pattern: ':menu'
}))
// Process Templates
.use(helpers())
.use(layouts({
engine: 'handlebars',
default: 'default-layout.hbs',
partials: 'partials',
pattern: '**/*.html'
}))
.use(minify())
.destination('./www')
.build(err => {
if (err) {
console.log(err);
process.exit(1);
}
});