forked from ipfs-inactive/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.js
executable file
·48 lines (43 loc) · 1.09 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
#!/usr/bin/env node
var Metalsmith = require('metalsmith')
var debug = require('metalsmith-debug')
var templates = require('metalsmith-templates')
var partial = require('metalsmith-partial')
var msstatic = require('metalsmith-static')
var serve = require('metalsmith-serve')
var watch = require('metalsmith-watch')
var nunjucks = require('nunjucks')
var njmd = require('nunjucks-markdown')
var marked = require('marked')
marked.setOptions({
gfm: true,
tables: true,
smartLists: true,
})
njmd.register(nunjucks.configure(), marked);
Metalsmith(__dirname)
.use(debug())
.use(templates({
"directory": ".",
"engine": "nunjucks",
"inPlace": true
}))
.use(templates({
"directory": ".",
"engine": "nunjucks",
}))
.use(msstatic({"src": "styles/", "dest": "ipfs.io/styles"}))
.use(msstatic({"src": "media/", "dest": "ipfs.io/media"}))
.use(msstatic({"src": "blog/", "dest": "ipfs.io/blog"}))
.use(serve({
"port": 8081,
"verbose": true
}))
.use(watch())
.destination('./build')
.build(function(err){
if (err) {
console.log(err)
throw err;
}
})