From 1bd2b62a80f3a7be330cb9600a2206a678e6863d Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Tue, 9 Apr 2013 11:48:16 -0500 Subject: [PATCH] Added support for deploying to github.io --- Rakefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 471b2277ce53..a57a56f68b1c 100644 --- a/Rakefile +++ b/Rakefile @@ -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, 'git@github.com:your_username/your_username.github.com)" + puts "(For example, 'git@github.com: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 @@ -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}")