Use source/CNAME (if it exists) to set _config.yml url property
This commit is contained in:
parent
9cf6b5ff83
commit
def01cb444
1 changed files with 5 additions and 1 deletions
6
Rakefile
6
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}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue