Skip to content

Instantly share code, notes, and snippets.

@karimmtarek
Forked from ls-lukebowerman/sitemap.xml.erb
Created December 20, 2013 22:08
Show Gist options
  • Select an option

  • Save karimmtarek/8062453 to your computer and use it in GitHub Desktop.

Select an option

Save karimmtarek/8062453 to your computer and use it in GitHub Desktop.
<% pages = sitemap.resources.find_all{|p| p.source_file.match(/\.html/) } %>
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<% pages.each do |p| %>
<url>
<loc>http://youdomain.com/<%=p.destination_path.gsub('/index.html','')%></loc>
<priority>0.7</priority>
</url>
<% end %>
</urlset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment