DocPad is the easiest way to create your static website. You have the power of a CMS and simplicity of a notepad. Write your website in the markup of your choice (Markdown, HTML, Jade?), in the editor of your choice (Textmate, Sublime, Notepad?), and deploy anywhere (FTP, Git, localhost?). Total control, total simplicity.
Pull request Compare This branch is 147 commits ahead, 1288 commits behind docpad:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

DocPad. It makes web development intuitive again.

Initially web development was pretty easy, you just wrote a bunch of files and you got your website. These days, it's a lot more complicated than that. Things like databases, synchronisation, legacy frameworks and languages all slow the entire process down into a painful crawl. It doesn't have to be like that.

DocPad takes that good ol' simple approach of writing files and wraps it with the best modern innovations, providing an awesome intuitive, liberating and empowering solution for HTML5 web design & development.

Let's take a look

  1. Say you were to create the following website structure:

    • myWebsite - src - documents - layouts - public
  2. And you were to create the following files:

    • A layout at src/layouts/, which contains

    • And another layout at src/layouts/, which contains:

       layout: default
    • And a document at src/documents/posts/, which contains:

       layout: post
       title: Hello World!
       Hello **World!**
  3. Then when you generate your website with docpad you will get a html file at out/posts/hello.html, which contains:

    	<head><title>Hello World!</title></head>
    		<h1>Hello World!</h1>
    		<div>Hello <strong>World!</strong></div>
  4. And any files that you have in src/public will be copied to the out directory. E.g. src/public/styles/style.css -> out/styles/style.css

  5. Allowing you to easily generate a website which only changes (and automatically updates) when a document changes (which when you think about it; is the majority of websites)

  6. Cool, now what was with the <%=...%> and <%-...%> parts which were substituted away?

    • This is possible because we parse the documents and layouts through a template rendering engine. The template rendering engine used in this example was Eco (hence the .eco extensions of the layouts). Templating engines allows you to do some pretty nifty things, in fact we could display all the titles and links of our posts with the following:

       <% for document in @documents: %>
       	<% if document.url.indexOf('/posts') is 0: %>
       		<a href="<%= document.url %>"><%= document.title %></a><br/>
       	<% end %>
       <% end %>
  7. Cool that makes sense... now how did Hello **World!** in our document get converted into Hello <strong>World!</strong>?

    • That was possible as that file was a Markdown file (hence the .md extension it had). Markdown is fantastic for working with text based documents, as it really allows you to focus in on your content instead of the syntax for formatting the document!


  1. Install Node.js

  2. Install dependencies

     npm install -g coffee-script
  3. Install DocPad

     npm install -g docpad
  4. or... install the cutting edge version

Getting errors? Try troubleshooting


  • Firstly, make a directory for your new website and cd into it

      mkdir my-new-website
      cd my-new-website
  • To get started, simply run the following - it will run all the other commands at once

      docpad run
  • To generate a basic website structure in the current working directory if we don't already have one

      docpad scaffold
  • To regenerate the rendered website

      docpad generate
  • To regenerate the rendered website automatically whenever we make a change to a file

      docpad watch
  • To run the docpad server which allows you to access the generated website in a web browser

      docpad server

Getting errors? Try troubleshooting



  • Markdown to HTML|markdown
  • Eco to anything
  • CoffeeKup to anything|coffeekup|coffee and HTML to CoffeeKup .ck|coffeekup|coffee.html
  • Jade to anything .anything.jade and HTML to Jade .jade.html
  • HAML to anything .anything.haml



  • CoffeeScript to JavaScript and JavaScript to CoffeeScript .coffee.js



DocPad is getting pretty popular these days... you can check out a bunch of websites already using it here, and discover the awesomely handsome crew behind the community here. Ocassionally we also hold events and competitions where you can learn more about docpad, hack with others together, and win some cool stuff! Nifty.

On that note, DocPad is awesomely extensible. You can download other people's plugins and use them in real quick, or even write your own in matters of minutes.

Best yet, definitely check out the entire wiki, as this has just been a small taste of it's awesomeness, and there is plenty awesomness left to be discovered.

Thanks. DocPad loves you.


  • v2.1 November 10, 2011

    • Support for dynamic documents
      • These are re-rendered on each request, must use the docpad server
      • See the search example in the kitchensink skeleton
    • Removed deprecated @Document, @Documents, and @Site from the templateData (the variables available to the templates). Use their lowercase equivalants instead. This can cause backwards compatibility problems with your templates, the console will notify you if there is a problem.
    • Fixed docpad --version returning null instead of the docpad version
  • v2.0 November 8, 2011

    • Upgrade guide for 1.x users
    • Tested and working on Node 0.4, 0.5, and 0.6
    • Configurable via package.json
      • DocPad is now configurable via it's and your website's package.json file
    • New plugin architecture
      • Plugins must now be isolated in their own directory
      • Plugins can now have their own package.json file
        • Use this for specifying plugin configuration, dependencies, etc
      • Plugin events have been renamed to before/after
        • New before/after events have been added
      • docpad and logger are now local variables, rather than passed arguments
        • Arguments are still kept for backwards compatibility - this may change
    • Generation changes
      • Rendering is now a 2-pass process
      • Contextualize is now a sub-step of parse, instead of it's own main step
        • Better simplicity, less complexity
      • Documents can now have multiple urls
        • These are customisable via the document's urls array property
    • Plugin Changes
      • REST plugin supports saving document data via POST (disabled by default)
      • Administration plugin adds front-end admin functionality (disabled by default)
      • SASS plugin
      • Coffee Plugin
        • Removed CoffeeCSS support as was playing up
  • v1.4 October 22, 2011

    • Template engines now have access to node.js's require
    • Less Plugin
    • Fixed NPM warning about incorrect property name
    • Logged errors will now also output their stacktraces for easier debugging
    • If an error occurs during rendering of a document, docpad will let us know which document it happened on
  • v1.3 October 3, 2011

    • Parsing is now split into two parts parsing and contextualizing
      • Contextualizing is used to determine the result filename, and title if title was not set
    • The code is now more concise
      • File class moved to lib/
      • Prototypes moved to lib/
      • Version checking moved to bal-util
    • File properties have changed
      • basename is extensionless
      • filename now contains the file's extnesions
      • id is now the relativeBase instead of the slug
      • extensionRendered is the result extension
      • filenameRendered is the result filename: `"#{basename}.#{extensionRendered}"
      • title if now set to filenameRendered if not set
    • Added support for different meta parsers, starting with CoffeeScript and YAML support. YAML is still the default meta parser.
    • The YAML dependency is specifically set now to v0.2.1 as the newer version has a bug in it.
    • Fixed multiple renderers for a single document. E.g.
    • Now also supports using ### along with --- for wrapping the meta data
    • Supports the public alias for the files directory
  • v1.2 September 29, 2011

  • v1.1 September 28, 2011

    • Added Buildr Plugin so you can now bundle your scripts and styles together :-)
    • The action method now supports an optional callback
    • Added a try..catch around the version detection to ensure it never kills docpad if something goes wrong
    • Skeletons have been removed from the repository due to circular references. The chosen skeleton is now pulled during the skeleton action. We also now perform a recursive git submodule init and update, as well as a npm install if necessary.
  • v1.0 September 20, 2011

  • v0.10 September 14, 2011

  • v0.9 July 6, 2011

    • No longer uses MongoDB/Mongoose! We now use Query-Engine which doesn't need any database server :)
    • Watching files now working even better
    • Now supports clean urls :)
  • v0.8 May 23, 2011

    • Now supports mutliple skeletons
    • Structure changes
  • v0.7 May 20, 2011

    • Now supports multiple docpad instances
  • v0.6 May 12, 2011

    • Moved to CoffeeScript
    • Removed highlight.js (should be a plugin or client-side feature)
  • v0.5 May 9, 2011

    • Pretty big clean
  • v0.4 May 9, 2011

    • The CLI is now working as documented
  • v0.3 May 7, 2011

    • Got the generation and server going
  • v0.2 March 24, 2011

  • v0.1 March 16, 2011


DocPad wouldn't be possible if it wasn't for the following libaries (in alphabetical order)


Licensed under the MIT License Copyright 2011 Benjamin Arthur Lupton