timstallard.me.uk/docpad.js

74 lines
1.4 KiB
JavaScript
Raw Normal View History

2016-01-07 10:25:27 +00:00
// DocPad Configuration File
// http://docpad.org/docs/config
var docpadConfig = {
collections: {
pages: function(){
return this.getCollection("html").findAllLive({relativeOutDirPath: "."}, [{order: 1}]);
},
posts: function(){
2016-11-04 22:35:09 +00:00
var posts = this.getCollection("html").findAllLive({relativeOutDirPath: "blog"}, [{date: -1}]);
posts.on("add", function(post){
post.setMetaDefaults({
layout: "blogpost"
});
});
return posts;
2016-01-07 10:25:27 +00:00
},
projects: function(){
var projects = this.getCollection("html").findAllLive({relativeOutDirPath: "projects"});
projects.on("add", function(project){
project.setMetaDefaults({
layout: "contentpage"
2016-01-07 10:25:27 +00:00
});
});
return projects;
2016-01-07 10:25:27 +00:00
}
},
plugins: {
cleanurls: {
static: true
},
moment: {
formats: [
{
raw: "date",
format: "MMMM Do, YYYY",
formatted: "formattedDate"
}
]
},
livereload: {
enabled: true
}
},
events: {
populateCollections: function(){
this.docpad.blocks["scripts"].add([
"/libs/jquery.min.js",
"/libs/jquery.smoothState.min.js",
"/script.js"
], {
defer: false
});
this.docpad.blocks["styles"].add([
"/libs/Animate.css",
"/libs/fa.css",
"/styles.css",
"https://fonts.googleapis.com/css?family=Open+Sans"
]);
}
},
environments: {
static: {
plugins: {
livereload: {
enabled: false
}
}
}
}
2016-01-07 10:25:27 +00:00
}
module.exports = docpadConfig;