forked from gjtorikian/markdowntutorial.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
36 lines (33 loc) · 865 Bytes
/
Rakefile
File metadata and controls
36 lines (33 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require 'rubygems'
require 'rake'
require 'rdoc'
require 'date'
require 'yaml'
require 'tmpdir'
require 'jekyll'
require 'fileutils'
desc "Generate blog files"
task :generate do
Jekyll::Site.new(Jekyll.configuration({
"source" => ".",
"destination" => "_site"
})).process
FileUtils.mv('_site/404/index.html', '_site/404.html')
FileUtils.touch '_site/.nojekyll'
end
desc "Generate and publish blog to gh-pages"
task :publish => [:generate] do
Dir.mktmpdir do |tmp|
system "mv _site/* #{tmp}"
system "git checkout gh-pages"
system "rm -rf *"
system "mv #{tmp}/* ."
message = "Site updated at #{Time.now.utc}"
system "git add ."
system "git commit -am #{message.shellescape}"
system "git push origin gh-pages --force"
system "git checkout master"
system "echo yolo"
end
end
task :default => :publish