Jekyll: A Ruby-Powered Static Site Generator
Jekyll is a simple Ruby-powered static site generator, originally by Tom Preston-Werner (aka mojombo) of Github fame. It's focused around blogging, but it can be configured to generate any kind of static site. (Note: Jekyll has been around for about a year - Tom originally blogged about it in November last year, so apologies if this is old news to some readers, but I've only recently discovered it!)
Because Jekyll outputs a static site structure, it means you can host your blog (or site) from anywhere that you can serve static HTML, simply by using your favourite web server (e.g. Apache). As Tom describes in his blog post, the idea came from wanting to be able to "Blog like a Hacker". Jekyll lets you write from the comfort of your favourite text editor, and publish from the command line. Using familiar tools reduces the cognitive load involved with publishing a blog, and lets you focus on what you're writing. It doesn't hurt that even a pretty weak Web server could stand a pounding if it's just serving static files!
By default, Jekyll uses its own (slightly modified) flavour of Liquid templates, with help from pygments for syntax highlighting, and you can use textile or markdown for the content. Each Jekyll blog article template needs a header containing some metadata about that article, such as what layout to use, the article's title, and any custom information you want to provide (such as tags for that article).
Generating your site is easy: just running the jekyll
command turns your directory of templates into a complete website, ready to serve. There's a Jekyll server that you can use for testing (passing --auto
as an argument means it will automatically regenerate the site when things are changed).
jekyll --server --auto
Github Pages provides a neat way to publish your Jekyll-generated site. Every Github page is actually run through Jekyll when you push content to your pages repo (this works because a normal static site is also a valid Jekyll site).
The easiest way to get started with Jekyll is by installing the gem (which is available on Gemcutter), and checking out the wiki on Github, where there's some great documentation.
sudo gem install jekyll
As you might expect, Tom Preson-Werner's personal blog runs on Jekyll. Its source is publicly available on Github.
November 5, 2009 at 9:42 pm
Jekyll is awesome. I've been using it for a couple of weeks with great success on GitHub Pages. It's definitely worth checking out. The Jekyll wiki has a lot of great blogs done in Jekyll that are open source on GitHub to learn from.
November 5, 2009 at 9:48 pm
There's plenty of sites running on Jekyll, if you need more examples to get started. http://wiki.github.com/mojombo/jekyll/sites
November 6, 2009 at 5:14 am
On top of Github pages, you can host your Jekyll sites on XP-Dev.com as well:
http://docs.xp-dev.com/user-guide/directfilehosting.html
November 6, 2009 at 6:12 am
It is kinda old news indeed, and the idea of Ruby-powered static site generators is hardly new itself. I counted *fourteen* different ones!
Jekyll is nice, mainly because it's integrated with GitHub pages, but personally I think nanoc (http://nanoc.stoneship.org/) is more mature and FAR more flexible. I recently moved my web site from Typo to nanoc and I didn't regret it -- just the ability to have custom metadata to associate to pages in nanoc made it worthwhile. Here's how I did it: http://www.h3rald.com/articles/take-back-your-site-with-nanoc/
November 6, 2009 at 8:51 am
> just the ability to have custom metadata to associate to pages in nanoc made it worthwhile.
You can associate metadata with posts in Jekyll too, so it's no different than Nanoc in that regard. In fact it's done in the same way (mixing YAML and post content).
November 7, 2009 at 11:02 am
I suspect that Jekyll is going to become the defacto standard static site generator, thanks to the GitHub association and name recognition. I've been happily using Webby (http://webby.rubyforge.org) for a while now, having switched from Nanoc. It supports all of the features mentioned, and has a nice Rails flavor, but doesn't seem to be talked about much.
November 7, 2009 at 2:27 pm
@Stuart: Agreed. Or.. as the Ruby way seems to be, we'll all be raving over some other new system within three months and Jekyll will be viewed as old hat. I only wish I were joking.. :-)
November 8, 2009 at 10:09 pm
staticmatic: http://staticmatic.rubyforge.org/
has also been around for quite a while, as another way to do this kind of thing in ruby.
November 9, 2009 at 6:00 pm
I moved my blog over to Jekyll after experimenting with a a little site on GitHub pages. As it is essentially text files it makes version control simple and there are all the benefits of serving just an HTML site. There are converters for anyone moving from the major blogging engines.
I haven't used any of the other Ruby based static site generators but I'm sold.
November 10, 2009 at 1:16 pm
I would like to join this discussion as lately
I have personally witnessed how powerful Jekyl is.
During one of my lectures I told my students to
replace their notebooks with blog.
I prepared a simple template for Jekyll and presented
it to prove that having a blog is easy and fun.
The results exceeded my expectations.
They can be seen here: http://github.com/popular/forked
under "jBlog" (currently 175 forks %-).
November 16, 2009 at 10:40 pm
I'm in the process of moving my blog to Middleman, a new entry into the Ruby-static-site-generator scene. The biggest motivator for me was the built-in haml and sass support, but it's got a ton of other great stuff. Check it out: http://github.com/tdreyno/middleman/
November 19, 2009 at 9:03 am
How To Make demon thread for the application
-d option is not working