Last active
August 29, 2015 14:00
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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