Skip to content

Commit

Permalink
Use https urls in sitemap file
Browse files Browse the repository at this point in the history
  • Loading branch information
saivann committed Jan 31, 2014
1 parent 40ea86d commit 080faae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions _plugins/sitemap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def generate(site)
next if locs[lang]['url'][id].nil? or locs[lang]['url'][id] == ''
next if redirects.has_key?(id) and ( !redirects[id].has_key?('except') or !redirects[id]['except'].has_key?(lang) )
sitemap.puts '<url>'
sitemap.puts ' <loc>http://bitcoin.org/'+lang+'/'+CGI::escape(locs[lang]['url'][id])+'</loc>'
sitemap.puts ' <loc>https://bitcoin.org/'+lang+'/'+CGI::escape(locs[lang]['url'][id])+'</loc>'
locs.each do |altlang,value|
altid = id
#If there is a redirection from this page, use the destination as alternate url
Expand All @@ -61,7 +61,7 @@ def generate(site)
sitemap.puts ' <xhtml:link'
sitemap.puts ' rel="alternate"'
sitemap.puts ' hreflang="'+altlang+'"'
sitemap.puts ' href="http://bitcoin.org/'+altlang+'/'+CGI::escape(locs[altlang]['url'][altid])+'" />'
sitemap.puts ' href="https://bitcoin.org/'+altlang+'/'+CGI::escape(locs[altlang]['url'][altid])+'" />'
end
sitemap.puts '</url>'
end
Expand All @@ -75,7 +75,7 @@ def generate(site)
data = File.read(file1+'/'+file2)
next if !data.index('window.location.href=').nil? or !data.index('redirect:').nil?
sitemap.puts '<url>'
sitemap.puts ' <loc>http://bitcoin.org/'+file1+'/'+file2.gsub('.html','')+'</loc>'
sitemap.puts ' <loc>https://bitcoin.org/'+file1+'/'+file2.gsub('.html','')+'</loc>'
sitemap.puts '</url>'
end
end
Expand All @@ -85,14 +85,14 @@ def generate(site)
data = File.read(file1)
next if !data.index('window.location.href=').nil? or !data.index('redirect:').nil? or !data.index('google-site-verification:').nil?
sitemap.puts '<url>'
sitemap.puts ' <loc>http://bitcoin.org/'+file1.gsub('.html','')+'</loc>'
sitemap.puts ' <loc>https://bitcoin.org/'+file1.gsub('.html','')+'</loc>'
sitemap.puts '</url>'
end
#Add english alerts pages
Dir.foreach('_alerts') do |file|
next if file == '.' or file == '..'
sitemap.puts '<url>'
sitemap.puts ' <loc>http://bitcoin.org/en/alert/'+file.gsub('.html','')+'</loc>'
sitemap.puts ' <loc>https://bitcoin.org/en/alert/'+file.gsub('.html','')+'</loc>'
sitemap.puts '</url>'
end
#Add english releases pages
Expand All @@ -105,7 +105,7 @@ def generate(site)
file.shift()
file = file.join('-')
sitemap.puts '<url>'
sitemap.puts ' <loc>http://bitcoin.org/en/release/'+file.gsub('.md','').gsub('.html','')+'</loc>'
sitemap.puts ' <loc>https://bitcoin.org/en/release/'+file.gsub('.md','').gsub('.html','')+'</loc>'
sitemap.puts '</url>'
end
#Close sitemap
Expand Down
2 changes: 1 addition & 1 deletion robots.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Sitemap: http://bitcoin.org/sitemap.xml
Sitemap: https://bitcoin.org/sitemap.xml

0 comments on commit 080faae

Please sign in to comment.