-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocpad.js
177 lines (143 loc) · 5.47 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
var docpadConfig,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
// The DocPad Configuration File
docpadConfig = {
// generated site at the root
// --------------------------
// outputPath: '.'
// Template Data
// -------------
// These are variables that will be accessible via our templates
// To access one of these within our templates, refer to the FAQ: https://github.com/bevry/docpad/wiki/FAQ
templateData: {
//
// All officers associated with ACM.
//
officers: {
president : {
name: "Stu Harvey",
role: "President",
email: "[email protected]",
picture: "/images/officers/stu_harvey.jpg",
bio: ""
},
// vice_president : {
// name: "Ryan Whitcomb",
// role: "Vice President",
// email: "[email protected]",
// picture: "/images/officers/ryan_whitcomb.png",
// bio: ""
// },
treasurer : {
name: "Hunter Morgan",
role: "Treasurer",
email: "[email protected]",
picture: "/images/officers/hunter_morgan.jpg",
bio: ""
},
// webmaster : {
// name: "",
// role: "Webmaster",
// email: "",
// picture: "/images/officers/officer_placeholder.jpg",
// bio: "Looking for replacement"
// },
/*event_coordinator : {
name: "",
role: "Event Coordinator",
email: "",
picture: "/images/officers/officer_placeholder.jpg",
bio: "Seeking new student!"
},*/
event_coordinator : {
name: "Ethan Mattice",
role: "Event Coordinator",
email: "[email protected]",
picture: "/images/officers/ethan_mattice.png",
bio: ""
}
},
// Specify some site properties
site: {
// The production url of our website
url: "http://www.acm.vt.edu/",
// The default title of our website
title: "ACM Virginia Tech",
// The website description (for SEO)
description: "The Virginia Tech chapter of the Association for Computing Machinery",
// The website keywords (for SEO) separated by commas
keywords: "acm, vt, virginia, tech, association, for, computing, machinery, computer, science, engineering, software, mobile, web, php, javascript, java, c, cpp, hackathon, raspberry, pi",
// The website author's name
author: "Chip Senkbeil",
// The website author's email
email: "[email protected]",
// The associated CSS styles
styles: [
"/styles/style.css"
],
// The associated scripts
scripts: [
"/scripts/acm_datetime.js",
"/scripts/acm_calendar.js",
"/scripts/acm_core.js"
]
},
// Helper Functions
// ----------------
// Get the prepared site/document title
// Often we would like to specify particular formatting to our page's title
// we can apply that formatting here
getPreparedTitle: function() {
if (this.document.title) {
// if we have a document title, then we should use that and suffix the site's title onto it
return "" + this.document.title + " | " + this.site.title;
} else {
// if our document does not have it's own title, then we should just use the site's title
return this.site.title;
}
},
// Get the prepared site/document description
getPreparedDescription: function() {
// if we have a document description, then we should use that, otherwise use the site's description
return this.document.description || this.site.description;
},
// Get the prepared site/document keywords
getPreparedKeywords: function() {
// Merge the document keywords with the site keywords
return this.site.keywords.concat(this.document.keywords || []).join(', ');
}
},
// Collections
// -----------
// These are special collections that
// our website makes available to us
collections: {
// For instance, this one will fetch in all documents that have pageOrder set within their meta data
pages: function(database) {
return database.findAllLive({
pageOrder: {
$exists: true
}
}, [
{
pageOrder: 1,
title: 1
}
]);
},
// This one, will fetch in all documents that have the tag "post" specified in their meta data
posts: function(database) {
return database.findAllLive({
tags: {
$has: ['post']
}
}, [
{
date: -1
}
]);
}
}
};
// Export our DocPad Configuration
module.exports = docpadConfig;