Process .md files with sitemap.rb

This commit is contained in:
Saivann 2014-05-10 12:13:26 -04:00
parent 096211c320
commit d258ee7c0b

View file

@ -51,20 +51,20 @@ module Jekyll
Dir.foreach('.') do |file1| Dir.foreach('.') do |file1|
if /^[a-z]{2}(_[A-Z]{2})?$/.match(file1) and File.directory?(file1) if /^[a-z]{2}(_[A-Z]{2})?$/.match(file1) and File.directory?(file1)
Dir.foreach(file1) do |file2| Dir.foreach(file1) do |file2|
next if !/\.html$/.match(file2) next if !/\.html$|\.md$/.match(file2)
data = File.read(file1+'/'+file2) data = File.read(file1+'/'+file2)
sitemap.puts '<url>' sitemap.puts '<url>'
sitemap.puts ' <loc>https://bitcoin.org/'+file1+'/'+file2.gsub('.html','')+'</loc>' sitemap.puts ' <loc>https://bitcoin.org/'+file1+'/'+file2.gsub('.html','').gsub('.md','')+'</loc>'
sitemap.puts '</url>' sitemap.puts '</url>'
end end
end end
next if !/\.html$/.match(file1) next if !/\.html$|\.md$/.match(file1)
next if file1 == 'index.html' next if file1 == 'index.html'
#Ignore google webmaster tools #Ignore google webmaster tools
data = File.read(file1) data = File.read(file1)
next if !data.index('google-site-verification:').nil? next if !data.index('google-site-verification:').nil?
sitemap.puts '<url>' sitemap.puts '<url>'
sitemap.puts ' <loc>https://bitcoin.org/'+file1.gsub('.html','')+'</loc>' sitemap.puts ' <loc>https://bitcoin.org/'+file1.gsub('.html','').gsub('.md','')+'</loc>'
sitemap.puts '</url>' sitemap.puts '</url>'
end end
#Add english alerts pages #Add english alerts pages