3 ms·
If your jekyll generation time is getting too large, you can limit the number of posts it generates like this: jekyll --limit_posts 3 It makes your site f
by spatten 12y ago
If your jekyll generation time is getting too large, you can limit the number of posts it generates like this:
jekyll --limit_posts 3
It makes your site feel like new again :) I made this into a rake task which I blogged about here:
http://scottpatten.ca/2011/11/speeding-up-jekyll-generation.html http://scottpatten.ca/2011/11/speeding-up-jekyll-generation....
- jacquesm 12y agoI looked at your blog post but it leaves some questions. Does this also update 'latest posts' boxes and tag clouds on all the other pages? What about the homepage? (I used OctoPress, not Jekyll but I suspect there is a way in there to use this same trick)
- spatten 12y agoNo, it definitely doesn't do that. I use the `limit_posts` option when I'm writing a single blog post, and then have a "rake deploy" task that re-generates the site fully (without the `limit_posts` option) before rsyncing it up to the server. I guess I should put the full Rakefile up on that post. Here are the relevant parts: desc "generate and deploy" task :deploy => ['jekyll:generate', 'deploy:deploy'] namespace :deploy do task :deploy do `rsync -r _site/ #{USER}@#{HOST}:#{DEPLOY_DIR}/` end end namespace :jekyll do desc "start the jekyll server in auto mode" task :server, :num_posts do |t, args| num_posts = args[:num_posts] cmd = "jekyll --auto --server --pygments" cmd += " --limit_posts #{num_posts}" if num_posts puts "running #{cmd}" exec(cmd) end desc "generate the site one time" task :generate => :clean do `jekyll --no-auto --pygments` end desc "remove the generated site" task :clean do `rm -rf _site` end end
- jacquesm 12y agoPity! Still, thanks for the tip (I can see one usecase for which it is handy, proofreading).