Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So there's a few ways DocPad facilitates dynamic content:</p> <ol> <li><p>Via the <code>regenerateEvery</code> <a href="http://docpad.org/docs/config">configuration option</a>. This will regenerate your website every so often you specify. This great when combined with plugins like <a href="http://docpad.org/plugin/feedr/">feedr</a> for pulling in data from remote feed sources (like your latest social activity), as well as <a href="http://docpad.org/plugin/repocloner/">repocloner</a> which clones out and keeps a git repository up to date inside your project. The benefit of this option is it's really easy to do and provides the illusion of a dynamic website. For instance the <a href="http://balupton.com/">Benjamin Lupton Website</a> applies this method to keep it's statistics on the home page, as well as the social data in the sidebar up to date. Every hour it regenerates with the latest information. Making it fast, and also illusively dynamic.</p></li> <li><p>Via the <code>dynamic</code> <a href="http://docpad.org/docs/meta-data">meta-data property</a>. When set to to <code>true</code> this tells the DocPad server we should re-render that document on each request, rather than just once. This works great inside the <a href="https://github.com/docpad/kitchensink.docpad/">Kitchensink Skeleton</a> for <a href="https://github.com/docpad/kitchensink.docpad/blob/master/src/documents/search.html.coffee">search pages</a> and <a href="https://github.com/docpad/kitchensink.docpad/blob/master/src/documents/nifties/dynamic.html.coffee">misc forms</a>. This way is most similar to PHP development.</p></li> <li><p>Via the <code>serverExtend</code> <a href="http://docpad.org/docs/events">event</a>. This event allows you to hook into and extend the DocPad server, allowing you to add extra server-side logic, handling, etc. Common use cases is to add extra routing to your server to handle route aliases, adding form processing such as a contact form, or to add a RESTULful interface for a Backbone.js application. The <a href="http://docpad.org">DocPad Website</a> uses this to <a href="https://github.com/bevry/docpad-website/blob/master/app/src/docpad.coffee">add extra routing and a regenerate post-receive hook for the documentation</a>. The <a href="https://github.com/balupton/nodechat.docpad">NodeChat Skeleton</a> uses this to <a href="https://github.com/balupton/nodechat.docpad/blob/master/docpad.coffee">add the Socket.io server-side logic</a>.</p></li> <li><p>Via the <a href="http://docpad.org/docs/api">API</a>. This way is the most involved but can be quite rewarding if you just wish for DocPad to be a small part of an existing node.js application. With this, you can create a DocPad instance in your code and interact with it. The <a href="https://github.com/shama/grunt-docs">grunt-docs</a> grunt task utilises this :)</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload