forked from paulahalldin/Paula-Halldin-Portfolio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.js
executable file
·71 lines (68 loc) · 1.82 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
62
63
64
65
66
67
68
69
70
71
const metalsmith = require('metalsmith')
const markdown = require('metalsmith-markdown')
const assets = require('metalsmith-assets')
const layouts = require('metalsmith-layouts')
const collections = require('metalsmith-collections')
const permalinks = require('metalsmith-permalinks')
const sass = require('metalsmith-sass')
const sitemap = require('metalsmith-sitemap')
const nunjucks = require('nunjucks')
metalsmith(__dirname)
.metadata({
site: {
name: 'Paula Halldin',
description: 'Portfolio'
}
})
.source('./src')
.destination('./public')
.clean(true)
.use(collections({
articles: {
pattern: 'articles/**/*.md',
sortBy: 'rank',
reverse: true
},
social: {
pattern: 'social/**/*.md',
sortBy: 'rank',
reverse: true
}
}))
.use(markdown())
.use(permalinks({
relative: false,
pattern: ':title',
// each linkset defines a match, and any other desired option
linksets: [{
match: { collection: 'articles' },
pattern: 'work/:title'
}]
}))
.use(sass({
outputStyle: 'expanded',
outputDir: './assets/css/'
}))
.use(assets({
source: './src/assets', // relative to the working directory
destination: './assets' // relative to the build directory
}))
.use(layouts({
engine: 'nunjucks',
directory: './layouts',
default: 'article.html',
pattern: ['*/*/*.html', '*/*.html', '*.html'],
partials: './layouts/partials'
}))
.use(sitemap({
'hostname': 'http://paulahalld.in/',
'pattern': ['**/*.html', '!page/**'],
'omitIndex': true
}))
.build((err) => {
if (err) {
console.log(err)
} else {
console.log('Successfully forged boilerplate!')
}
})