-
Notifications
You must be signed in to change notification settings - Fork 0
/
metalsmith-build.js
64 lines (63 loc) · 1.58 KB
/
metalsmith-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
62
63
64
var Metalsmith = require('metalsmith'),
markdown = require('metalsmith-markdown'),
layouts = require('metalsmith-layouts'),
inPlace = require('metalsmith-in-place'),
prism = require('metalsmith-prism'),
static = require('metalsmith-static'),
moveUp = require('metalsmith-move-up'),
dateInFilename = require('metalsmith-date-in-filename'),
discoverHelpers = require('metalsmith-discover-helpers'),
collections = require('metalsmith-collections'),
layoutByPath = require(__dirname + '/lib/layout-by-path'),
inlineSource = require(__dirname + '/lib/inline-source'),
serve = require('metalsmith-serve'),
debug = require('metalsmith-debug');
Metalsmith(__dirname)
.use(serve({
port: 8080,
verbose: true
}))
.metadata({
title: "Gregory Igelmund",
layout: "page.html"
})
.source('./src/content')
.destination('./docs')
.clean(true)
.use(static({
src: "src/public",
dest: "."
}))
.use(discoverHelpers())
.use(markdown({ langPrefix: 'language-' }))
.use(prism())
.use(dateInFilename(true))
.use(collections({
posts: {
pattern: "posts/*.html",
sortBy: "date",
reverse: true
},
pages: {
pattern: "pages/**/*.html"
}
}))
.use(layoutByPath())
.use(layouts({
engine: "handlebars",
directory: "src/layouts",
default: "page.html",
partials: "src/layouts/partials"
}))
.use(inPlace())
.use(inlineSource())
.use(moveUp("pages/**/*"))
.use(debug())
.build(function (err) {
if (err) {
console.log(err);
}
else {
console.log('Site build complete!');
}
});