hscc

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

commit a8642783335c8e695b33c16e0edcc49c1421ed89
parent caefaa7d5446ffccf0ba6d47eaf72f956d2fb7d3
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Tue,  5 Oct 2021 21:01:00 -0400

Start the setup to have sitemap.xml

Diffstat:
Mconfig.lua | 2++
Atemplates/sitemap.xml.html | 11+++++++++++
2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/config.lua b/config.lua @@ -10,6 +10,8 @@ return { generator = "Satelito", }, + sitemapxml = true, + author = { name = "Hugo Soucy", nickname = "hs0ucy", diff --git a/templates/sitemap.xml.html b/templates/sitemap.xml.html @@ -0,0 +1,11 @@ +<?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 %> + <url> + <loc><%= entry.permalink -%></loc> + <lastmod><%- os.date('%Y-%m-%dT%H:%M:%S', entry.time_modification) -%>Z</lastmod> + </url> + <% end %> + <% end %> +</urlset>