Some Octopress Rake Tips
This is a quick post just to scratch one of my own itches. I’ve been using Octopress every single day for around two months now and the generation time for my blog is slowly starting to creep up. I’d heard that you could isolate a post and just preview/generate it instead of doing the whole blog every time but it wasn’t until today that I finally decided to look into it.
Turns out it’s really simple. Let’s say we are going through our usual steps of creating a new post:
rake new_post["Today is a Wonderful Day"]
Now that we have our post ready we can isolate it from all the others:
rake isolate[wonderful-day]
Notice I didn’t pass in the entire filename? That’s because the Rake task inspects each of our posts and stashes anything that doesn’t include the String ‘wonderful-day’ in the filename.
Now that our post is isolated we can preview it, like we always do:
rake preview
Write a little bit, save, and hit localhost:4000
to see your super speedy blog post!
When we’re all done we integrate the post back in with the rest of our blog.
rake integrate
And finally we generate and deploy it, which can be done in a single command:
rake gen_deploy
There are a few other useful rake tasks, you can see the whole list by running:
rake -T
I’m looking forward to trying out Octopress 2.1 as it includes a more streamlined generate task as well as some other nifty features. - Rob
You should follow me on Twitter here.
- Mood: Caffeinated
- Sleep: 7
- Hunger: 0
- Coffee: 1