This post originated from an RSS feed registered with Ruby Buzz
by Scott Patten.
Original Post: Speeding up Jekyll Generation
Feed Title: Scott Patten's Blog
Feed URL: http://feeds.feedburner.com/scottpatten.ca
Feed Description: Scott Patten is the cofounder of Ruboss (http://ruboss.com) and Leanpub (http://leanpub.com), both based in Vancouver.
He is also the author of The S3 Cookbook (http://leanpub.com/thes3cookbook).
He blogs about Startups, Ruby, Rails, Javascript, CSS, Amazon Web Services and whatever else strikes his fancy.
One of the only complaints you’ll see out there about Jekyll is that when sites get bigger, it starts to slow down.
Luckily, this is easy to fix. Unfortunately, it’s apparently not obvious as you still see people complaining about it. Here’s my attempt at proselytizing for Jekyll :).
If you run jekyll --help, you’ll see that there’s a --limit_posts option. If you set this to 1, then you’ll only re-generate your most recent post when you save. This is usually exactly what you want. If you’re working on a slightly older post, then bump it up to 3 or 4.
Like this:
jekyll --limit_posts 1
I’ve put this in a rake task
namespace:jekylldodesc"start the jekyll server in auto mode"task:server,:num_postsdo|t,args|num_posts=args[:num_posts]cmd="jekyll --auto --server --pygments"cmd+=" --limit_posts #{num_posts}"ifnum_postsputs"running #{cmd}"exec(cmd)endend
So I can start Jekyll like this:
rake jekyll:server[1]
and only see the current post, and it’s blazing fast.