hscc

Soure code of <https://hugo.soucy.cc>.
git clone git://soucy.cc/hscc.git
Log | Files | Refs

sitemap.xml.html (773B)


      1 <?xml version="1.0" encoding="utf-8"?>
      2 <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
      3   <% if sitemap then %>
      4     <!-- Sort by the time_modification field -->
      5     <% table.sort(sitemap, function(a, b) return tonumber(a.time_modification) > tonumber(b.time_modification) end) %>
      6 
      7     <% for i = 1, #sitemap do %>
      8       <url>
      9         <loc><%= sitemap[i].permalink -%></loc>
     10         <lastmod><%- os.date('%Y-%m-%dT%H:%M:%S', sitemap[i].time_modification) -%>Z</lastmod>
     11         <% if sitemap[i].changefreq then %>
     12           <changefreq><%= sitemap[i].changefreq -%></changefreq>
     13 	      <% end %>
     14         <% if sitemap[i].priority then %>
     15           <priority><%= sitemap[i].priority -%></priority>
     16         <% end %>
     17       </url>
     18 	  <% end %>
     19 	<% end %>
     20 </urlset>