aboutsummaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorBrandon Mathis <brandon@imathis.com>2013-08-22 22:23:03 -0700
committerBrandon Mathis <brandon@imathis.com>2013-08-22 22:23:03 -0700
commitb7756c462b703eafb15c8e9423fa73bb5add63d0 (patch)
treeb7ddce48c1c55e7a83bfc058e13f87d436035f83 /Rakefile
parent9cf6b5ff8303522648ef01a510cca43c0563887c (diff)
parent7f19c78cd53369cac01c1b107e9147c72de6d22a (diff)
downloadmy_new_personal_website-b7756c462b703eafb15c8e9423fa73bb5add63d0.tar.xz
my_new_personal_website-b7756c462b703eafb15c8e9423fa73bb5add63d0.zip
Merge pull request #1328 from sharethrough/master
Use the CNAME from /source when (re)generating _config.yml
Diffstat (limited to '')
-rw-r--r--Rakefile13
1 files changed, 10 insertions, 3 deletions
diff --git a/Rakefile b/Rakefile
index f3ada93d..ce6ba4ad 100644
--- a/Rakefile
+++ b/Rakefile
@@ -337,10 +337,8 @@ task :setup_github_pages, :repo do |t, args|
end
end
end
- url = "http://#{user}.github.io"
- url += "/#{project}" unless project == ''
jekyll_config = IO.read('_config.yml')
- jekyll_config.sub!(/^url:.*$/, "url: #{url}")
+ jekyll_config.sub!(/^url:.*$/, "url: #{blog_url(user, project)}")
File.open('_config.yml', 'w') do |f|
f.write jekyll_config
end
@@ -385,6 +383,15 @@ def ask(message, valid_options)
answer
end
+def blog_url(user, project)
+ url = if File.exists?('source/CNAME')
+ "http://#{IO.read('source/CNAME').strip}"
+ else
+ "http://#{user}.github.io"
+ end
+ url += "/#{project}" unless project == ''
+end
+
desc "list tasks"
task :list do
puts "Tasks: #{(Rake::Task.tasks - [Rake::Task[:list]]).join(', ')}"