Merge pull request #1331 from Darkhogg/patch-1

Fixed setup_github_pages failing and not properly writing url to _config.yml
This commit is contained in:
Parker Moore 2014-10-23 15:01:37 -07:00
commit c6c5b74f4d

View File

@ -341,8 +341,9 @@ task :setup_github_pages, :repo do |t, args|
end
end
end
url = blog_url(user, project)
jekyll_config = IO.read('_config.yml')
jekyll_config.sub!(/^url:.*$/, "url: #{blog_url(user, project)}")
jekyll_config.sub!(/^url:.*$/, "url: #{url}")
File.open('_config.yml', 'w') do |f|
f.write jekyll_config
end
@ -391,7 +392,7 @@ def blog_url(user, project)
url = if File.exists?('source/CNAME')
"http://#{IO.read('source/CNAME').strip}"
else
"http://#{user}.github.io"
"http://#{user.downcase}.github.io"
end
url += "/#{project}" unless project == ''
url