satelito-sample

This is a sample web site for the Satelito ssg.
git clone git://soucy.cc/satelito-sample.git
Log | Files | Refs

commit 919019d42354e2950cace2533e81e0dbe679e376
parent b62fd41959622e7b80b70a959fdefb01df9420a2
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Mon, 24 Jan 2022 14:51:33 -0500

Modify the sitemap.xml loop

Diffstat:
Mtemplates/sitemap.xml.html | 12+++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/templates/sitemap.xml.html b/templates/sitemap.xml.html @@ -1,10 +1,16 @@ <?xml version="1.0" encoding="utf-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <% if sitemap then %> - <% for _, entry in pairs(sitemap) do %> + <% for i = 1, #sitemap do %> <url> - <loc><%= entry.permalink -%></loc> - <lastmod><%- os.date('%Y-%m-%dT%H:%M:%S', entry.time_modification) -%>Z</lastmod> + <loc><%= sitemap[i].permalink -%></loc> + <lastmod><%- os.date('%Y-%m-%dT%H:%M:%S', sitemap[i].time_modification) -%>Z</lastmod> + <% if sitemap[i].changefreq then %> + <changefreq><%= sitemap[i].changefreq -%></changefreq> + <% end %> + <% if sitemap[i].priority then %> + <priority><%= sitemap[i].priority -%></priority> + <% end %> </url> <% end %> <% end %>