rake generate can take quite a while, especially when you have many blog
posts. Here are a few tips on how to speed up the generation process.
rake isolate and
It's usually the case when you have many existing posts, while you're modifying
a few of them, it's certainly a overkill to compile all the posts if you just
ant to preview what you're really editing. Octopress provide an
command just for this purpose.
The idea is, you can use
rake isolate to move all no-interested posts in an
separate directory outside
source/_posts , so when you do
you'll just compile those posts you care about. When you're done editing and
want to deploy your sites, you can use
rake integrate to move those posts back
and generate a complete site.
The usage of
rake isolate is simple, you just provide the keywords, and those
posts whose title contain these keywords are kept, other posts are moved to
source/_stash. Say I'm composing a post named
2013-04-07-hello-world.markdown, and assume this post is the only one that
hello in its title. Then the following command will do the job:
$ rake isolate[hello]
Use rb-gsl to boost lsi computation
Jekyll has builtin support for related posts, so as Octopress. You just need to
add this line to your
Once you enabled
lsi, you'll definite want to install
rb-gsl package to make
the related post generation process faster. When Octopress remind you that:
Notice: for 10x faster LSI support, please install http://rb-gsl.rubyforge.org/
It's not kidding!
Note that Octopress doesn't work with the latest gsl versioned
need to install gsl
1.14 manually since
yum will probably install
1.15.* for you.
wget http://ftp.gnu.org/gnu/gsl/gsl-1.14.tar.gz tar xvf gsl-1.14.tar.gz cd gsl-1.14 ./configure make sudo make install
Check the installation by the
gsl-config --version 1.14
Then edit your
Gemfile in your blog source root. Add the following line in the
bundle to install it.
You're all set. Now when you do
rake generate, you shouldn't see that
faster line anymore.