Static Site Generators Are The New Wordpress
11 Feb 2012 by TuxAdminLately I've been toying with the idea of converting this site to a static one. A site that does away the need for a database or a scripting language.
What's wrong with Wordpress or any dynamic site for that matter?
Nothing much really.
Wordpress works great for most parts. Its simple to setup, easy to use and customize. I also happen to know server administration well enough to fine tune the backend services like Apache, Nginx, PHP and MySQL. It has become fairly painless to setup and maintain Wordpress and other PHP powered scripts, especially when utilizing my LAMP and LNMP scripts.
Still, being a fan of minimalism, I'm very intrigued by the prospect of a zero maintenance website. A blog or site that can be left online without the worry of getting hacked for reasons beyond my control. E.g. being away on holidays when a critical Wordpress vulnerability is making rounds across the internet.
Pros and cons of using a static site generator.
Advantages
- Fast. Static sites are pretty much guaranteed to survive traffic spikes with minimal tuning of the webserver.
- Secure. There are few security concerns for a site that is read-only.
- Portable. I can backup public_html anywhere (dropbox, git, etc) and restore the site instantly on any server.
- Powerful text manipulation. Since all content are stored in plain text files, it is very easy to perform advanced text processing on them (searching, mass updating etc).
Disadvantages
- No built in commenting or pingback system. Fortunately, externally hosted comments are available with Disqus, LifeFyre or Intense Debate.
- No built in site search.
- Extremely steep learning curve for people without programming exposure.
- Large sites can take a long time to generate.
Which Static Site Generator?
After researching a few potential static site generators, I've narrowed a few down to a few that appealed to me. If you're considering doing the static site switch, look no further than Octopress or Pelican. Here are my thoughts on them, along with other interesting static site generators:-
1. Jekyll, Octopress (Ruby + Liquid + Markdown / Textile)
I initially decided to use Octopress / Jekyll because of its popularity, especially with the Ruby programming community. Octopress in particular ships as a complete package, with deployment scripts, a decent theme and so on.
However, my excitement for Octopress quickly died down in the midst of installing it. Now, this is probably me being a complete newbie with the Ruby workflow, but I was getting errors one after another while following each step of the official documentation. I gave up after about the 6th error or so with RVM. Its is a shame because Octopress seemed like the obvious choice.
2. Blogofile (Python + Mako + Markdown / Rst / Textile)
Link to Blogofile
Blogofile was recommended most for those who prefer a Python static site generator. However, the project's development seems to have stopped completely. I decided not to try it, but I should probably give it another look in future.
3. Hyde (Python + Jinja2 + Markdown)
Link to Hyde
Hyde is touted to be the python clone of Jekyll. I really hope this is not the case because it's documentation is almost non-existent and the default way of structuring content is very strange. Content text are jumbled together with the template engine codes (Jinja2). Why?! Content should be in clean markup language.
In its defence, the project is still in its development phase, so I suppose its worth having a look at it again when its ready.
4. Pelican (Python + Jinja2 + Markdown / Rst )
Link to Pelican
I was pleasantly surprised with this one. Unlike the rest, Pelican is extremely simple to use. You don't have to learn various bits about its behaviour, nor do you have to write additional codes & scripts to start using it. You can pretty much generate a static site in 5 minutes from scratch. Pelican uses Jinja2 for templates and supports both markdown and restructured text for the content. A very solid combination if you ask me.
With the default settings, you get a themed site that is basic but usable. The CLI tool can be configured to watch for content updates, which is pretty cool.
Going Static Yo!
I've actually converted Tuxlite.com to its static site equivalent using Pelican. Except for the wordpress comments, everything should be intact (hopefully). I didn't fancy any of the default themes, so I made my own using Twitter's Bootstrap.
Comments will likely be disabled permanently, but that's OK because you folks prefer emailing me anyway.