-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.js
64 lines (62 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
var fs = require('fs');
var CleanCSS = require('clean-css');
var metalsmith = require('metalsmith');
var markdown = require('metalsmith-markdown');
var highlighter = require('highlighter');
var layouts = require('metalsmith-layouts');
var inplace = require('metalsmith-in-place');
var permalinks = require('metalsmith-permalinks');
var collections = require('metalsmith-collections');
var redirect = require('metalsmith-redirect');
var contentTitles = require(__dirname + '/plugins/content-titles');
var blogData = require(__dirname + '/plugins/blog-data');
metalsmith(__dirname)
.metadata({
authorName: 'Khen Daniel',
domainUrl: "http://khendaniel.com",
description: "This is my site",
logo: fs.readFileSync('src/assets/images/kd-logo.html.svg'),
icon: fs.readFileSync('src/assets/images/favicon.ico'),
css: new CleanCSS().minify(fs.readFileSync('src/assets/style.css')).styles
})
.source('src')
.destination('build')
// .use(markdown({
// gfm: true,
// tables: true,
// highlight: highlighter()
// }))
.use(markdown('commonmark'))
.use(contentTitles())
.use(blogData())
.use(collections({
latestPosts: {
sortBy: 'date',
pattern: 'blog/*/*/*.html',
reverse: true,
limit: 5
},
posts: {
sortBy: 'date',
pattern: 'blog/*/*/*.html',
reverse: true
}
}))
.use(inplace({
pattern: '**/*.hbs',
}))
.use(layouts({
pattern: ['*.html', '**/*.html'],
default: 'layout.html.hbs'
}))
.use(permalinks({
relative: false
}))
.use(redirect({
'/ama': 'https://github.com/thekhenzie/ama/'
}))
.build(function (err) {
if (err) {
throw err;
}
});