Skip to content

Instantly share code, notes, and snippets.

@eduncan911
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eduncan911/11059005 to your computer and use it in GitHub Desktop.
Save eduncan911/11059005 to your computer and use it in GitHub Desktop.
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