.txtfile in Notepad, we will be using
plain-textas the markup. But say we want to get more advanced, and add things like bold text or italic text to our content, then we could use a markup like
Microsoft Word (.doc),
Rich Text Format (.rtf)or simply
HTML (.html). These markups allow us to express our content with rich formatting.
**bold**, where in HTML it is
<strong>bold</strong>. The markup that you choose for your content is highly dependent on what content you'd like to write. If you're mostly dealing with structural data (like a page layout) then
CoffeeKupwould be a good way to go. If you're mostly dealing with textual data (like a blog post) then
Markdownwould probably the way to go.
jpgor binary-text formats like
rtf(they're not plain-text formats like
xmlbut in fact binary formats) does not currently work. We will be addressing this in a future release of DocPad.
.ecoat the end of your file (e.g.,
my-blog-post.html.eco). It doesn't have to be at the end, but it mustn't be the first extension (as the first extension is what you are rendering to).
.html.ecomeans process this with Eco and render it as HTML. Alternatively, we can get pretty inventive and do something like this:
.html.md.ecowhich means process this with Eco, then Markdown and finally render it as HTML.
findAlland the second is
findAlldoes a once-off scan of all the models in the collection that matches the criteria and returns the result in a new Backbone Collection, pretty standard stuff.
findAllLivecreates a new child collection with the original collection as the parent, the new child collection then listens to the change events of the parent, and will automatically test the changes against the child collection's criteria. This is incredibly efficient for long running collections, where data changes over time.
findAllLivefor short-lived collections (especially in your templates). It will cause more and more and more child collections and listeners to be created and added, causing a memory leak and unexpected results.
findAllwhen you are needing once-off/short-living collections. Typical use cases are inside your templates or inside other events within your plugin.
renderPassesconfiguration option for each amount of cross document references you have.
src/render/404.htmlfor 404 pages, and
src/render/500.htmlfor 500 pages. If you create a dynamic page (adding the
dynamic: truemeta data header) your templating engine (e.g.,
404.html.eco) will also get access to
req(the request instance),
res(the response instance),
err(the error that occurred - for 500 errors pages only, not for 404 error pages). Allowing you to do something like this for
<% your business logic %>or to output a variable we can use
<%[email protected]%>. The reason for the
@is because Eco associates the
templateDatato the current scope, which with CoffeeScript (what Eco uses) you access by using the
--offlineoption and see if that works. :)
./cyclic.js, what is this?