Add a rake site:generate command and use Ruby instead of a subprocess.
This commit is contained in:
parent
a822219086
commit
774c65a869
17
Rakefile
17
Rakefile
|
@ -134,6 +134,7 @@ namespace :site do
|
||||||
desc "Generate and view the site locally"
|
desc "Generate and view the site locally"
|
||||||
task :preview do
|
task :preview do
|
||||||
require "launchy"
|
require "launchy"
|
||||||
|
require "jekyll"
|
||||||
|
|
||||||
# Yep, it's a hack! Wait a few seconds for the Jekyll site to generate and
|
# 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.
|
# then open it in a browser. Someday we can do better than this, I hope.
|
||||||
|
@ -145,9 +146,19 @@ namespace :site do
|
||||||
|
|
||||||
# Generate the site in server mode.
|
# Generate the site in server mode.
|
||||||
puts "Running Jekyll..."
|
puts "Running Jekyll..."
|
||||||
Dir.chdir("site") do
|
Jekyll::Commands::Serve.process({
|
||||||
sh "#{File.expand_path('bin/jekyll', File.dirname(__FILE__))} serve"
|
"source" => File.expand_path("site"),
|
||||||
end
|
"destination" => File.expand_path("site/_site")
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Generate the site"
|
||||||
|
task :generate => [:history, :version_file] do
|
||||||
|
require "jekyll"
|
||||||
|
Jekyll::Commands::Build.process({
|
||||||
|
"source" => File.expand_path("site"),
|
||||||
|
"destination" => File.expand_path("site/_site")
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Update normalize.css library to the latest version and minify"
|
desc "Update normalize.css library to the latest version and minify"
|
||||||
|
|
Loading…
Reference in New Issue