-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.js
48 lines (45 loc) · 1.15 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
/**
* Build static HTML files using Metalsmith
*/
var metalsmith = require("metalsmith")
, changed = require("metalsmith-changed")
, ignore = require("metalsmith-ignore")
, layouts = require("metalsmith-layouts")
, assets = require("metalsmith-assets")
, remarkable = require("metalsmith-markdown-remarkable")
, remarkableHighlighter = require("./lib/remarkable/highlighter")
, remarkableExtender = require("./lib/remarkable")
, handlebarsExtender = require("./lib/handlebars")()
, pkg = require("./package.json");
metalsmith(__dirname)
.clean(false)
.use(changed())
.use(ignore([
".git"
]))
.source("./src")
.destination("./build")
//.concurrency(2024)
.use(remarkable("full", {
html: true
,breaks: true
,typographer: true
,langPrefix: ""
,highlight: remarkableHighlighter
}).use(remarkableExtender))
.use(layouts({
engine: "handlebars"
,default: "default.hbs"
,partials: "partials"
}))
.use(assets({
source: "./static"
,destination: "./"
}))
.build(function (err) {
if (err) {
console.log(err);
} else {
console.log("Site build complete!");
}
});