Render drafts if Octopress.env is not production.

This commit is contained in:
Parker Moore 2013-03-16 23:50:14 +01:00
parent 17311872d6
commit fcc512626a
2 changed files with 3 additions and 3 deletions

View File

@ -110,7 +110,7 @@ task :generate do
configurator.write_configs_for_generation configurator.write_configs_for_generation
puts "## Generating Site with Jekyll" puts "## Generating Site with Jekyll"
system "compass compile --css-dir #{configuration[:source]}/stylesheets" system "compass compile --css-dir #{configuration[:source]}/stylesheets"
system "jekyll build" system "jekyll build #{"--drafts" unless Octopress.env == 'production'}"
unpublished = get_unpublished(Dir.glob("#{configuration[:source]}/#{configuration[:posts_dir]}/*.*"), {env: Octopress.env, message: "\nThese posts were not generated:"}) unpublished = get_unpublished(Dir.glob("#{configuration[:source]}/#{configuration[:posts_dir]}/*.*"), {env: Octopress.env, message: "\nThese posts were not generated:"})
puts unpublished unless unpublished.empty? puts unpublished unless unpublished.empty?
configurator.remove_configs_for_generation configurator.remove_configs_for_generation

View File

@ -20,7 +20,7 @@ module Guard
if Watcher.match_files(self, Dir.glob('{,**/}*{,.*}').uniq).size > 0 if Watcher.match_files(self, Dir.glob('{,**/}*{,.*}').uniq).size > 0
configurator = Octopress::Configuration.new configurator = Octopress::Configuration.new
configurator.write_configs_for_generation configurator.write_configs_for_generation
system "jekyll build" system "jekyll build #{"--drafts" unless Octopress.env == 'production'}"
configurator.remove_configs_for_generation configurator.remove_configs_for_generation
end end
end end
@ -28,7 +28,7 @@ module Guard
def run_on_changes(_) def run_on_changes(_)
configurator = Octopress::Configuration.new configurator = Octopress::Configuration.new
configurator.write_configs_for_generation configurator.write_configs_for_generation
system "jekyll build" system "jekyll build #{"--drafts" unless Octopress.env == 'production'}"
configurator.remove_configs_for_generation configurator.remove_configs_for_generation
end end
end end