Skip to content

Commit

Permalink
Added support for deploying to github.io
Browse files Browse the repository at this point in the history
  • Loading branch information
imathis committed Apr 9, 2013
1 parent afca876 commit 1bd2b62
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -304,11 +304,11 @@ task :setup_github_pages, :repo do |t, args|
repo_url = args.repo
else
puts "Enter the read/write url for your repository"
puts "(For example, '[email protected]:your_username/your_username.github.com)"
puts "(For example, '[email protected]:your_username/your_username.github.io)"
repo_url = get_stdin("Repository url: ")
end
user = repo_url.match(/:([^\/]+)/)[1]
branch = (repo_url.match(/\/[\w-]+\.github\.com/).nil?) ? 'gh-pages' : 'master'
branch = (repo_url.match(/\/[\w-]+\.github\.(?:io|com)/).nil?) ? 'gh-pages' : 'master'
project = (branch == 'gh-pages') ? repo_url.match(/\/([^\.]+)/)[1] : ''
unless (`git remote -v` =~ /origin.+?octopress(?:\.git)?/).nil?
# If octopress is still the origin remote (from cloning) rename it to octopress
Expand All @@ -328,7 +328,7 @@ task :setup_github_pages, :repo do |t, args|
end
end
end
url = "http://#{user}.github.com"
url = "http://#{user}.github.io"
url += "/#{project}" unless project == ''
jekyll_config = IO.read('_config.yml')
jekyll_config.sub!(/^url:.*$/, "url: #{url}")
Expand Down

0 comments on commit 1bd2b62

Please sign in to comment.