Add site namespace and rename site preview/publish rake tasks.
This commit is contained in:
parent
6c02483255
commit
88bdb15338
12
Rakefile
12
Rakefile
|
@ -115,8 +115,9 @@ end
|
|||
#
|
||||
#############################################################################
|
||||
|
||||
desc "Generate and view the site locally"
|
||||
task :site do
|
||||
namespace :site do
|
||||
desc "Generate and view the site locally"
|
||||
task :preview do
|
||||
# Yep, it's a hack! Wait a few seconds for the Jekyll site to generate and
|
||||
# then open it in a browser. Someday we can do better than this, I hope.
|
||||
Thread.new do
|
||||
|
@ -128,10 +129,10 @@ task :site do
|
|||
# Generate the site in server mode.
|
||||
puts "Running Jekyll..."
|
||||
sh "cd site && jekyll --server"
|
||||
end
|
||||
end
|
||||
|
||||
desc "Commit the local site to the gh-pages branch and deploy"
|
||||
task :site_release do
|
||||
desc "Commit the local site to the gh-pages branch and deploy"
|
||||
task :publish do
|
||||
# Ensure the gh-pages dir exists so we can generate into it.
|
||||
puts "Checking for gh-pages dir..."
|
||||
unless File.exist?("./gh-pages")
|
||||
|
@ -153,6 +154,7 @@ task :site_release do
|
|||
sha = `git log`.match(/[a-z0-9]{40}/)[0]
|
||||
sh "cd gh-pages && git add . && git commit -m 'Updating to #{sha}.' && git push"
|
||||
puts 'Done.'
|
||||
end
|
||||
end
|
||||
|
||||
#############################################################################
|
||||
|
|
Loading…
Reference in New Issue