From def01cb4441a08a4dca4b4be4d44c8684857f648 Mon Sep 17 00:00:00 2001 From: Rob Slifka Date: Wed, 21 Aug 2013 16:42:03 -0700 Subject: [PATCH] Use source/CNAME (if it exists) to set _config.yml url property --- Rakefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index f3ada93..f16a5f4 100644 --- a/Rakefile +++ b/Rakefile @@ -337,7 +337,11 @@ task :setup_github_pages, :repo do |t, args| end end end - url = "http://#{user}.github.io" + url = if File.exists?('source/CNAME') + "http://#{IO.read('source/CNAME').strip}" + else + "http://#{user}.github.io" + end url += "/#{project}" unless project == '' jekyll_config = IO.read('_config.yml') jekyll_config.sub!(/^url:.*$/, "url: #{url}")