-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathapp.js
More file actions
45 lines (43 loc) · 1.29 KB
/
app.js
File metadata and controls
45 lines (43 loc) · 1.29 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
var port = process.env.PORT || 5000;
var docpadInstanceConfiguration = {
templateData: {
site: {
title: "Сайт и блог программиста",
url: "http://blog.programmer-site.tk"
}
},
getTitle: function() {
if (this.document.title) {
return "" + this.document.title + " [" + this.site.title + "]";
} else {
return this.site.title;
}
},
getDescription: function() {
if (this.document.description) {
return this.document.description;
}
return "Пример сайта и блога программиста";
},
collections: {
posts: function(database) {
return database.findAll({
relativeOutDirPath: 'posts'
}, [{
date: -1
}]);
}
},
port: port
};
var docpadInstance = require('docpad').createInstance(docpadInstanceConfiguration, function(err) {
if (err) {
return console.log(err, err.stack);
}
return docpadInstance.action('generate server', function(err) {
if (err) {
return console.log(err, err.stack);
}
return console.log("Running on @:" + port);
});
});