At the moment, I'm setting up a new DocPad-project and I explicitly require certain meta data to be set. If not set, I want DocPad to give me some sort of warning, alas I can't find any hints online on how to set it up.
My file default.html.eco prints the title by accessing it from the document, like so:
<%= @document.title %>
However, when it's not set, the output is just empty.
I would like DocPad to warn me about the missing data. Is there a setting I'm missing?
You can handle this a number of ways.
1. Conditional
2. Postfix Conditional
3. Console
If you would like to receive a warning you can call console.log("whatever you want here.") and it will be output by node.js into your terminal.
4. Query/Collection level
If you would like to not render documents without titles you could handle that at the query level in /docpad.coffee
This will check to make sure the document has a title before putting it into the pages collection.
5. Prototype the document object
You could rewrite the document object I suppose as well to overload the attribute calls and have it output a console warning in the event that that attribute doesn't exist, but that'd be much more low level...