Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Isolate all posts so you can work on the styling and other pages.
# add this to your Rakefile for your Jekyll or Octopress source.
# you can then call it like this:
#
# $ rake isolate_posts
#
# remember, do NOT 'git add .' because your posts will be deleted (stashed) in
# a git-ignored directory!
#
# when you are ready to commit, the workflow should be like:
#
# $ rake integrate
# $ git add .
# $ git commit -m "blah"
#
desc "Move all posts to a temporary stash location (stash) so regenerating the site happens much more quickly."
task :isolate_posts do
stash_dir = "#{source_dir}/#{stash_dir}"
FileUtils.mkdir(stash_dir) unless File.exist?(stash_dir)
Dir.glob("#{source_dir}/#{posts_dir}/*.*") do |post|
FileUtils.mv post, stash_dir
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment