Mar 13th 2014From Wordpress to Octopress to DocPad

I have been wanting to move many Wordpress-projects to static sites for a long time because I was annoyed by having to maintain them by installing updates. Even though this is very easy to do in Wordpress, it just takes up too much time if you have more than 1 installation running.

To Octopress

This is why I ported my blog (this one right here) to Octopress about half a year ago. While I did enjoy writing in Markdown and everything, I just don't know any ruby at all and the whole system did seem kind of mysterious to me. So instead of making a customized template as originally planned, I ended up leaving the default theme and setup almost completely unchanged.

About 2 weeks ago, I started looking for alternatives to Octopress, preferrably ones that were written for node.js. I tried out various projects and almost gave up because they all seemed to be over-complicated or not flexible enough. Then, I discovered DocPad and it just clicked.

To DocPad!

DocPad is kind of the CMS-system I've been silently looking for forever. Built for developers in a form that content is still a breeze to manage. You create documents (in Markdown or whatever you like) and they are rendered to static pages using predefined templates.

Use your favorite templating systems and preprocessors

To write templates, you can use any templating-system you can imagine. I use jade but you can also use stuff like Handlebars, coffeecup and even PHP!

You don't even have to decide on which templating-system you use, you can combine them. For example, I could layout my blogposts using jade by having a template called post.html.jade and create a sitemap with PHP by naming the template sitemap.xml.php.

The same goes for assets like Javascript-files and stylesheets. Transform them magically by naming them or style.css.scss. You can also chain these preprocessors together by doing stuff like style.css.scss.php.

I prefer to use my own system for compiling sass and concatenating/minifying assets using gulp and it works great, too!

Powerful document-querying

DocPad uses query-engine as its database. Any files that are part of your project are referenced as collections and can be queried when writing plugins and templates. It's fairly easy to grasp, works really well and is very powerful.

Plugins are easy

On my first day of using DocPad, I already wrote my first plugin. Although there aren't any real tutorials out there, the system is very easy to grasp. The advantage of using static site-generators like Jekyll/Octopress is, that you can easily customize the output of your documents. As a Javascript-guy, DocPad is the first static site-generator I came across with a system that really is intuitive.

It's not just blogging-software

Many other static site generators are written with a particular use case in mind. Many times this is blogging or documentation. DocPad doesn't even care, you can do whatever you want with it! Check out the official showcase and you'll find many different web projects that are powered by DocPad.

It's not just static site

I have yet only used DocPad as a static site generator but it has express built-in so the possibilities are pretty much endless. I haven't used this feature yet but I'm sure it's great, especially for content-heavy websites that might have restricted areas or stuff like that.

In conclusion: DocPad is awesome

I'm really excited about DocPad. I've been actually enjoying working on content-heavy sites which is something I haven't for the past, say – 3 years. All the requirements seem to be met and if not, it's easy to implement them by writing a plugin.

This blog is my second DocPad-project now and I plan on using DocPad a lot more.

If you're interested in DocPad, I suggest you check out this video by DocPad's creator Benjamin Lupton to see it in action. Also don't forget the official DocPad website.