lib/sitemap.erb in bridgetown-sitemap-2.0.1 vs lib/sitemap.erb in bridgetown-sitemap-2.0.2

- old
+ new

@@ -11,26 +11,44 @@ <% collection.resources.each do |resource| %> <% next if resource.id == "/404" || resource.data.sitemap == false %> <url> <loc><%= xml_escape resource.absolute_url %></loc> <lastmod><%= resource.sitemap_last_modified_at.localtime.xmlschema %></lastmod> + <% if resource.data.sitemap_priority %> + <priority><%= resource.data.sitemap_priority %></priority> + <% end %> + <% if resource.data.sitemap_change_frequency %> + <changefreq><%= resource.data.sitemap_change_frequency %></changefreq> + <% end %> </url> <% end %> <% end %> <% site.generated_pages.each do |generated_page| %> <% next if ["sitemap.erb", "robots.liquid"].include? generated_page.name %> <% next if generated_page.data.sitemap == false %> <url> <loc><%= xml_escape absolute_url(generated_page.url) %></loc> <lastmod><%= (generated_page.data.last_modified_at || site.time).localtime.xmlschema %></lastmod> + <% if generated_page.data.sitemap_priority %> + <priority><%= generated_page.data.sitemap_priority %></priority> + <% end %> + <% if generated_page.data.sitemap_change_frequency %> + <changefreq><%= generated_page.data.sitemap_change_frequency %></changefreq> + <% end %> </url> <% end %> <% page.data.static_files.each do |file| %> <% next if file.data.sitemap == false %> <url> <loc><%= xml_escape absolute_url(file.relative_path) %></loc> <lastmod><%= file.modified_time.localtime.xmlschema %></lastmod> + <% if file.data.sitemap_priority %> + <priority><%= file.data.sitemap_priority %></priority> + <% end %> + <% if file.data.sitemap_change_frequency %> + <changefreq><%= file.data.sitemap_change_frequency %></changefreq> + <% end %> </url> <% end %> </urlset>