Merge pull request #1328 from sharethrough/master

Use the CNAME from /source when (re)generating _config.yml
main
Brandon Mathis 11 years ago
commit b7756c462b

@ -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(', ')}"

Loading…
Cancel
Save