Last active
December 11, 2015 21:28
-
-
Save Stwissel/4662223 to your computer and use it in GitHub Desktop.
Docpad Struggles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Configure DocPad | |
docpadConfig = { | |
templateData: | |
# Get a collection of available categories | |
getCategoryList: -> | |
workCollection = @getCollection('documents') | |
resultCollection = {} | |
for document in workCollection | |
resultCollection[document.category] = document.category | |
return resultCollection | |
} | |
# Export | |
module.exports = docpadConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<% for category in @getCategoryList(): %> | |
<li> | |
<a href="/byCategory/<%= category %>.html"> | |
<%= category %> | |
</a> | |
</li> | |
<% end %> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: default | |
author: "Stephan H Wissel" | |
category: ["After hours", "Twins"] | |
--- | |
Having <b>Twins</b> is fun |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment