-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
40 lines (38 loc) · 1.2 KB
/
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
const metalsmith = require('metalsmith')
const msIf = require('metalsmith-if')
const ignore = require('metalsmith-ignore')
const inplace = require('metalsmith-in-place')
const markdown = require('metalsmith-markdown')
const watch = require('metalsmith-watch')
const args = process.argv.slice(2)
/**
* takes the `watch` command line arg to run the watcher
*/
metalsmith(__dirname)
.metadata({
siteUrl: "http://ckingbailey.com",
author: "Colin King-Bailey",
description: "Colin King-Bailey's portfolio and resume",
keywords: "ckb web-developer portfolio resume javascript css html react expressjs nodejs mern-stack php mysql lamp-stack",
generatorname: "Metalsmith",
generatorurl: "http://metalsmith.io/"
})
.source('./src')
.destination('./public')
.clean(true)
.use(markdown())
.use(inplace())
.use(ignore([ "**/_dev/*", "../**/layouts/includes" ]))
.use(msIf(
args[0] === "watch",
watch({
paths: {
"${source}/**/*": "**/*",
"layouts/**/*": "**/*"
},
livereload: args[0] === "watch"
})
))
.build(err => {
if (err) throw err
})