Skip to content

Instantly share code, notes, and snippets.

@joshchernoff joshchernoff/Rakefile
Last active Dec 19, 2015

What would you like to do?
Publish your jeykll _site files to master so that you can build out your jekyll plugins for uses with github pages. Source from
require "jekyll"
require 'tmpdir'
GITHUB_REPONAME = "digitalcake/"
SOURCE = "."
'layouts' => File.join(SOURCE, "_layouts"),
'posts' => File.join(SOURCE, "_posts")
desc "Generate blog files"
task :generate do{
"source" => ".",
"destination" => "_site"
desc "Generate and publish blog to gh-pages"
task :publish => [:generate] do
Dir.mktmpdir do |tmp|
cp_r "_site/.", tmp
Dir.chdir tmp
system "git init"
system "git add ."
message = "Site updated at #{}"
system "git commit -m #{message.shellescape}"
system "git remote add origin{GITHUB_REPONAME}.git"
system "git push origin master --force"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.