Repository navigation
Expand file tree
/
Copy pathindex.js
More file actions
105 lines (105 loc) · 3.45 KB
/
Copy pathindex.js
File metadata and controls
105 lines (105 loc) · 3.45 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
var Metalsmith = require('metalsmith');
var del = require('del');
del.sync(['build/**','!build','!build/.git/**']);
Metalsmith(process.cwd())
.clean(false)
.metadata({
title: "Kina Works",
description: "Kina's Website",
navs: [{
icon: "<span class=\"glyphicon glyphicon-download-alt\" aria-hidden=\"true\"></span>",
ref: "app/",
title: "App"
}, {
icon: "<span class=\"glyphicon glyphicon-cloud\" aria-hidden=\"true\"></span>",
ref: "app/web/",
title: "WEBApp"
}, {
icon: "<span class=\"glyphicon glyphicon-music\" aria-hidden=\"true\"></span>",
ref: "music/",
title: "Music"
}, {
icon: "<span class=\"glyphicon glyphicon-blackboard\" aria-hidden=\"true\"></span>",
ref: "image/",
title: "Image"
}, {
icon: "<span class=\"glyphicon glyphicon-pencil\" aria-hidden=\"true\"></span>",
ref: "log/",
title: "Log"
}, {
icon: "<span class=\"glyphicon glyphicon-flash\" aria-hidden=\"true\"></span>",
ref: "other/",
title: "Misc"
}, {
icon: "<span class=\"glyphicon glyphicon-user\" aria-hidden=\"true\"></span>",
ref: "me.html",
title: "Me"
}, {
icon: "<span class=\"glyphicon glyphicon-gift\" aria-hidden=\"true\"></span>",
ref: "donate.html",
title: "Donate"
}, {
icon: "<span class=\"glyphicon glyphicon-link\" aria-hidden=\"true\"></span>",
ref: "link.html",
title: "Link"
}]
})
.use((require('metalsmith-drafts'))())
.use((require('metalsmith-env'))())
.use((require('metalsmith-updated'))())
.use((require('metalsmith-register-helpers'))({
directory: "./helpers"
}))
.use((require('./local_plugins/crafterkina-addmeta/index.js'))({
'log/post/**': "log/post/metadata.json"
}))
.use((require('metalsmith-paths'))({
directoryIndex: "index.html"
}))
.use((require('metalsmith-metallic'))())
.use((require('metalsmith-assets'))({
source: "./assets",
destination: "./assets"
}))
.use((require('metalsmith-tags'))({
handle: "tags",
metadataKey: "allTags",
path: "log/tags/:tag.html",
layout: "tag.html",
sortBy: "created",
reverse: false,
skipMetadata: false
}))
.use((require('metalsmith-collections'))({
'blog-posts': {
pattern: "log/post/**",
sortBy: "created",
reverse: false
}
}))
.use((require('metalsmith-rss'))({
feedOptions:{
site_url:"https://crafterkina.github.io"
},
collection: "blog-posts",
destination: "log/rss.xml"
}))
.use((require('metalsmith-rootpath'))())
.use((require('metalsmith-in-place'))({
engine: "handlebars",
partials: "layouts/partials"
}))
.use((require('metalsmith-markdown'))())
.use((require('metalsmith-layouts'))({
engine: "handlebars",
partials: "layouts/partials",
rename: true
}))
.use((require('metalsmith-html-minifier'))("*.html"))
// .use((require('./local_plugins/crafterkina-showmeta/index.js'))())
.build(
function(err) {
if (err) throw err;
console.log('Build finished!');
}
);