From Wordpress.com to DocPad

I've moved away from WordPress.com for hosting of my blog. Due to a combination of wanting more control over my site (and not having to pay for some of that control) plus the chance to try out some of these static site generators that are available for Node.js

WordPress.com exodus

My first step in migration was to grab an export from WordPress. Easily enough to achive through the dashboard and selecting the options to export. This produced an XML file with all my pages, posts and comments. My only issue with the resulting XML was WordPress's source for each of my posts. Each was HTML based, still including their shortcode tags (not much of a problem) but without any paragraph tags.

DocPad

After toying around with some static site generates and investigating other potentially related projects like Ghost, I settled on DocPad. It appeared to be very popular in comparison to other similar projects and I found the documentation very useful.

What I liked

Control

I ended up feeling much more in control of my site than when I've used a CMS / Blogging platform. While I do miss having a front-end to create content easily, it's nice having such a flexible system and simplified hosting requirements.

Speed (on the server)

It's all static :) Don't need to worry about any effort trying to boost performance or stressing over a database.

Annoyances

Markdown

This one isn't really the fault of DocPad, more of an issue with the Markdown parsers available. I really like Markdown, but wanted just a little extra control. There's a few other flavours of Markdown available, like Maruku and the "Extra" versions. Of which, I liked the idea of being able to specify attributes for the generated HTML the most.

![Fake image](image.png){:.img-thumbnail}
<img src="image.png" alt="Fake image" class="img-thumbnail">

Plus inline HTML was a must. Unfortunately for me, I couldn't find a decent parser for Node.js that supported this extra syntax and allowed inline HTML. Markdown-js was the best I stumbled across but didn't support the inline HTML. In the end I modified the library to prevent it escape HTML characters (except within code examples). Then I replaced the "Marked" module used by a docpad plugin to process markdown to HTML. Worked in the end ;-)

RSS

There's an RSS plugin available. I would have liked to use it but it didn't seem flexible enough to allow me to only use the initial part of a blog post in the feed, instead of the whole article. Instead I went with an XML template that creates the feed itself, allow me the extra flexibility when constructing the RSS feed.

Performance

With just over 100 posts, DocPad takes a long time to regenerate on my slightly old laptop. Not especially the fault of DocPad but an annoyance for me when updating my site. I'm still finding my way around DocPad, so I may have contributed to the generation time in some way.


Comments


David Boyer
David Boyer

Full-stack web developer from Cardiff, Wales. With a love for JavaScript, especially from within Node.js.

More...