-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocpad.js
87 lines (85 loc) · 2.17 KB
/
docpad.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// http://docpad.org/docs/config
require('longjohn');
module.exports = {
templateData: {
site: {
title: "blog.linx.dj",
description: "open collaboration of linx.dj",
styles: ["styles/index.css"],
scripts: ["scripts/bundle.js"],
url: "http://blog.linx.dj",
},
postFull: function (html, ctx) {
html = "<!-- toc -->" + html;
return require('toc').process(html, {
tocMin: 1,
anchorMin: 1,
tocMax: 2,
anchorMax: 2,
openLI: '<li><a href="' + ctx.site.url + ctx.document.url + '#<%= anchor %>"><%= text %></a>',
});
},
postMin: function (html, ctx) {
html = "<!-- toc --><!-- posttoc -->" + html;
html = require('toc').process(html, {
tocMin: 1,
anchorMin: 1,
tocMax: 2,
anchorMax: 2,
openLI: '<li><a href="' + ctx.site.url + ctx.document.url + '#<%= anchor %>"><%= text %></a>',
});
return html.split("<!-- posttoc -->")[0];
},
},
detectEncoding: true,
plugins: {
browserifybundles: {
bundles: [{
arguments: ['-g', 'uglifyify'],
entry: 'scripts/index.js',
out: 'scripts/bundle.js',
}],
environments: {
development: {
bundles: [{
arguments: ['-d'],
entry: 'scripts/index.js',
out: 'scripts/bundle.js',
}],
},
},
},
raw: {
'font-awesome': {
command: ['rsync', '-r', 'node_modules/font-awesome/fonts/', 'out/fonts'],
},
semantic: {
command: ['rsync', '-r', 'node_modules/semantic/src/fonts/', 'out/fonts'],
},
},
ghpages: {
deployRemote: 'origin',
deployBranch: 'gh-pages',
},
},
collections: {
posts: function () {
return this.getCollection('html').findAllLive({
relativeOutDirPath: 'posts',
isPagedAuto: { $ne: true },
}, { "date": -1 }).on("add", function (model) {
model.setMetaDefaults({ layout: "postLayout" });
});
}
},
environments: {
development: {
port: 5000,
templateData: {
site: {
url: "http://localhost:5000",
}
}
},
},
};