Skip to content

Instantly share code, notes, and snippets.

@sathishmanohar
Created January 20, 2016 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sathishmanohar/27fe3fd64474980687d8 to your computer and use it in GitHub Desktop.
Save sathishmanohar/27fe3fd64474980687d8 to your computer and use it in GitHub Desktop.
Middleman sitemap.xml generator developed from https://gist.github.com/lukebowerman/3287848
---
sitemap_noindex: true
sitemap_priority: 0.8
---
---
directory_index: false
---
<% pages = sitemap.resources.find_all{|p| p.source_file.match(/\.html/) && !p.data.sitemap_noindex == true } %>
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<% pages.each do |p| %>
<url>
<loc>http://balcozy.com<%=p.url.gsub('/index.html','')%></loc>
<changefreq>monthly</changefreq>
<priority><%= p.data.sitemap_priority || 0.5 %></priority>
</url>
<% end %>
</urlset>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment