Release jekyllrb.com as a locally-compiled site.
This commit is contained in:
parent
6d4a1ec4e6
commit
aec5ceb184
27
Rakefile
27
Rakefile
|
@ -203,26 +203,21 @@ namespace :site do
|
||||||
end
|
end
|
||||||
|
|
||||||
# Copy site to gh-pages dir.
|
# Copy site to gh-pages dir.
|
||||||
puts "Copying site to gh-pages branch..."
|
puts "Building site into gh-pages branch..."
|
||||||
copy_exclude = %w[
|
ENV['JEKYLL_ENV'] = 'production'
|
||||||
site/.
|
require "jekyll"
|
||||||
site/..
|
Jekyll::Commands::Build.process({
|
||||||
site/.jekyll-metadata
|
"source" => File.expand_path("site"),
|
||||||
site/.sass-cache
|
"destination" => File.expand_path("gh-pages"),
|
||||||
site/_site
|
"sass" => { "style" => "compressed" },
|
||||||
]
|
"full_rebuild" => true
|
||||||
FileList["site/{*,.*}"].exclude(*copy_exclude).each do |path|
|
})
|
||||||
sh "cp -R #{path} gh-pages/"
|
|
||||||
end
|
|
||||||
|
|
||||||
# Change any configuration settings for production.
|
File.open('gh-pages/.nojekyll', 'wb') { |f| f.puts(":dog: food.") }
|
||||||
config = YAML.load_file("gh-pages/_config.yml")
|
|
||||||
config.merge!({'sass' => {'style' => 'compressed'}})
|
|
||||||
File.write('gh-pages/_config.yml', YAML.dump(config))
|
|
||||||
|
|
||||||
# Commit and push.
|
# Commit and push.
|
||||||
puts "Committing and pushing to GitHub Pages..."
|
puts "Committing and pushing to GitHub Pages..."
|
||||||
sha = `git log`.match(/[a-z0-9]{40}/)[0]
|
sha = `git rev-parse HEAD`.strip
|
||||||
Dir.chdir('gh-pages') do
|
Dir.chdir('gh-pages') do
|
||||||
sh "git add ."
|
sh "git add ."
|
||||||
sh "git commit --allow-empty -m 'Updating to #{sha}.'"
|
sh "git commit --allow-empty -m 'Updating to #{sha}.'"
|
||||||
|
|
Loading…
Reference in New Issue