Skip to content

Instantly share code, notes, and snippets.

@connatser
Created September 17, 2011 22:45
Show Gist options
  • Save connatser/1224454 to your computer and use it in GitHub Desktop.
Save connatser/1224454 to your computer and use it in GitHub Desktop.
Guard rake
guard 'rake', :task => 'parse_haml' do
watch(%r{_source/_layouts/haml/})
end
desc "Parse haml layouts"
task :parse_haml do
print "Parsing Haml layouts..."
system(%{
cd _source/_layouts/haml &&
for f in *.haml; do [ -e $f ] && haml $f ../${f%.haml}.html; done
})
puts "done."
end
desc "Launch preview environment"
task :preview do
Rake::Task["parse_haml"].invoke
system "jekyll --auto --server"
end
desc "Build site"
task :build do |task, args|
Rake::Task["parse_haml"].invoke
system "jekyll"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment