Hacker News new | past | comments | ask | show | jobs | submit login
How To: WordPress to Jekyll (paulstamatiou.com)
104 points by PStamatiou on Jan 25, 2011 | hide | past | favorite | 36 comments



Prompted by security holes in Wordpress that resulted in spam links embedded in my blog, I switched to Jekyll about a year ago. The switch was painful, but the results were good.

A few months later, I switched from Jekyll, which is written in Ruby, to http://blogofile.com, which is very similar to Jekyll, but written in Python. The second switch was prompted by one of the parsers in Jekyll repeatedly choking on bad markup left over from Wordpress, but failing to reveal the location of the parse errors.

I've subsequently used Blogofile for a larger site that includes both static pages and a blog. It's worked extremely well.


  choking on bad markup left over from Wordpress,
  but failing to reveal the location of the parse errors.
I have this one nagging issue where it says I have an unclosed liquid highlight tag but I have no idea what post it's in.


Yeah, that was exactly the problem I had-- Liquid error, but no idea what post contained the problem. I ended up doing a binary search by removing half of the posts, re-running Jekyll to see if the error persisted, and so forth.

Fortunately, the switch to another blog compiler is easy once you've got everything as flat files.


+1 for blogofile, I've been redoing all my sites in it, including http://www.sqlalchemy.org


I've been running Blogofile for a year now and really enjoy it as well, very clean and awesome to have everything in git and push-button updatable.


As I read it, he had to sacrifice a lot of features (tags, archives, related posts) to gain... what exactly? Every time he publishes a post he has to generate all of the pages again (because of the "recent post" links, etc.), which takes 6 minutes. With WordPress (et al.) it takes a few seconds.

I am not against Jekyll. It sounds like a cool project. But I'm just curious if moving from WordPress to Jekyll really is worth doing, even if you're a developer/geek and like to tinker with software.

If you need to do it for speed, consider using Varnish to cache most everything. Items you cache will probably be at least as fast to serve as static html.

(Btw. this reminds me of craigslist way of publishing entries).


Jekyll best serves a particular type of user and their needs. I'm a WordPress developer and make my living off it, but I absolutely hated using it for my personal site.

Now I can open my site in Textmate, make my changes, and use git to push to my server all in less time than it would take to do the same in WP. I don't give anything up(you can have archives, tags, and related posts in Jekyll) by switching and gain quite a bit of flexibility. Jekyll also fits into how I like to do things(ruby/textmate) which is incredibly important to some people.

So yes there are cases where Jekyll makes more sense. Depends on the user.


There are addons to most advanced editors to publish WordPress-posts directly from the editor (vimpress, wp-emacs). Writing the posts in Markdown or similar is also trivial to do with WordPress.

Mind you, I'm not trying to advocate WordPress, but when I say WordPress you can substitute it with any simple, easy to install CMS.

I used to create my own CMS just for my blog. But then I needed some new features, but didn't have time to write them. So I just switched to WP, where most features are just an addon away. The only problem I have is that I need to update it whenever a security bug is discovered. For that security I see the advantage of Jekyll.


I'm guessing most people do it either because of security or for deployment into non-wordpress situations (e.g., you can basically host your small blog/site for free in App Engine).

For infrequently updated sites where there aren't multiple authors, wordpress is overkill and not worth the security concerns, IMO.


The title made me think "really, another one?", turns out it was definitely well worth writing (and, indeed, reading).

Interestingly, Jekyll does give you, at least if you are the right kind of person, a sense of satisfaction that seems to make a lot of people, myself included, want to write about the fact that they're using it (albeit not normally in as much detail).

And that same sense of satisfaction comes whenever writing a post or editing the site - or even when reading a blog like this. I guess it's just one of those things that's really easy to fall in love with.


I fall guilty to this...


I've been using something very similar for my blog for the past month or so, it's called Toto. Flat file, git, Ruby, Markdown, Disqus, etc. Check it out: http://cloudhead.io/toto and a good post on how to get up and running http://fadeyev.net/2010/05/10/getting-started-with-toto/ . It was really fast and simple to go from 0 to blogging. The default template is nice too (jlank.com)


I used Blosxom for several years, which is a Perl blogging system with a similar minimalist approach to blogging, and includes a static method of site generation so you can use it in the same way.

I switched off of it because WordPress has a lot more templates available, and my web design skills just aren't that great. But, I often think I'd like to give it another go. It is more fun to write in vim than a web based editor.



Killer post, wish I had this 6 months ago. I also use Jekyll on ginzametrics.com and it has been a dream. Your site is much bigger than mine so I haven't encountered the rebuild time issues, but it's good to know about.

Static files are definitely the way to go.


Jekyll is great, and it's great to be able to have your writing as nice old text files that you can grep and you'll be able to read 20 years from now. I've been using it for quite a while to blog from org-mode, another great piece of software, and I'm not looking back. If you want to go that way you might be interested in the emacs module I wrote to make it easy, org-jekyll: http://juanreyero.com/open/org-jekyll/


Most of this post was over my head since I'm not a programmer, but I really enjoyed the part where Stammy explained what caused his site's revenue to fall. I'll be interested to see how this change affects his search rankings.


Another fun trick with jekyll is to use sinatra to let you host it on Heroku. :) Their varnish will make your blog get hosted at lightning speed, and it's free.


Ugh. The length of that article (and the reliance on Disqus for comments) is why I'm still using WordPress.

I'd use a hosted service, but I haven't found one that can properly import my posts and comments. Is there such a thing? I know Posterous is close, but I don't think they import comments.

I still love Mint, too. I wish someone would build a hosted version of something just like it. If you're thinking the same thing and want to team up, drop me a line ;)


The length of the article is in part due to how in-depth he goes, and in part due to how customised he wanted it. Realistically you could get a Jekyll site setup in ~10 minutes.

As to comments, on my Jekyll blog I opted not to bother with comments, but yeah, Disqus (or equivilent) is probably the best option. A possible second option would be to tell Apache to run all the .html files through PHP, and use PHP to add in a database-driven comments system. Sure, it won't be as fast as HTML-only, but it will still cut down the load time by not using any database queries for the rest of the site.


There are several reasons one may decide to use jekyll, but I think speed is the least important one. First, this is a solution for small websites and blogs. I don't see how a large scale website would be generated from static pages, anyway. Second, there are simple methods to cache wordpress content without resorting to static pages.


You can get a Jekyll site running in ten minutes if you know how to use:

- Ruby gems

- Git

- Liquid Templates

- Yaml

You can get a WordPress blog running in minutes knowing a lot less.


Great article. It would be cool if someone posted a similary article for Hyde: http://ringce.com/hyde


Indeed. I don't know how their features compare, but hey, Hyde is built on Python. :-)


Not only is it built on Python, but it uses Django's templating system.


I understand that static pages are better but is there anything wrong with using Wordpress? You didn't really explain other than wanting to learn a new tool, why leave Wordpress? I run a bunch of sites on Wordpress and you've got me worried now. What am I missing out there?


The three reasons I see are speed, security, and workflow. A static site will generally be faster (although with good caching and configuration, you can generally make Wordpress pretty fast). Also nice to not have to worry about any potential WordPress exploits. Finally, since WP entries are stored in a database, the most common way to create and edit them is through the browser. Lots of folks are more productive with the editors they are already using for coding websites.

That said, WordPress successfully powers millions of sites and certainly isn't going away. And since it is dynamic, you get some nice features that would be difficult to replicate with the static site approach. If it works for you, I'd stick with it without worry.

Finally, you can always publish a static clone of a blog created in Wordpress. I've done this before on production sites and it worked well. An extra step, but I got the speed I was after without having to migrate or recreate the site.


Wow this is a very thorough post. Kudos to Paul for writing this.

Funny enough, I was just looking into moving from WordPress to Jekyll myself. Blogs really should be just static files.


All the random rake stuff I wrote while writing this post itself as I came up with the ideas for them, so the code is kinda dirty and needs a good refactoring. :)


I had a similar experience using Jekyll. I really like it, but I suspect it's more hacker-oriented. I did toy with the idea of making yet-another-blogging platform that was Jekyll based, simply because going flat file gets around a lot of the scaling issues we frequently see when the big sites go down under load, or get fireballed/farked/dotted, etc.. It would make it easy to support multiple methods of post access as well.


> Like any other hacker I just wanted to learn a new tool.

Hey, Stammy, and like that you summed up in a neat little package pretty much every anxiety I've had.

Great article.


Epic post but very well done (as usual!) and informative. I'm going to have to work on setting up my own Jekyll.


I have no experience with Jekyll, but is there some way to do a "limited rebuild" to overcome the rebuild time issues?

For a blog, all that really needs to be updated (aside from generating the new post) are index / archive / tag pages, right? Can't you just rebuild them, while leaving old posts alone?


It's not supported natively in mojombo's Jekyll but I have seen one fork with such a feature. It's on my to-checkout list.


Cool - thanks.


Nice article. Liking the clean new look.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: