Last active
August 29, 2015 14:13
-
-
Save croaky/88399895df2cb6c08705 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> | |
<url> | |
<loc>http://robots.thoughtbot.com</loc> | |
<priority>1.0</priority> | |
<changefreq>daily</changefreq> | |
</url> | |
<% sitemap_articles.each do |page| %> | |
<url> | |
<loc>http://robots.thoughtbot.com/<%= page.destination_path.gsub("/index.html", "")%></loc> | |
<priority>0.8</priority> | |
</url> | |
<% end %> | |
<% sitemap_tags.each do |page| %> | |
<url> | |
<loc>http://robots.thoughtbot.com/<%= page.destination_path.gsub("/index.html", "")%></loc> | |
<priority>0.2</priority> | |
<changefreq>weekly</changefreq> | |
</url> | |
<% end %> | |
</urlset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SitemapHelpers | |
def sitemap_articles | |
sitemap.resources.select do |page| | |
page.path.start_with?("posts/") | |
end | |
end | |
def sitemap_tags | |
sitemap.resources.select do |page| | |
page.path.start_with?("tags/") | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!