Branch
Hash :
ae614143
Author :
Thomas de Grivel
Date :
2025-09-03T12:11:09
fix test/httpd dump and optimize doc_index and sitemap
## kc3
## Copyright from 2022 to 2025 kmx.io <contact@kmx.io>
##
## Permission is hereby granted to use this software granted the above
## copyright notice and this permission paragraph are included in all
## copies and substantial portions of this software.
##
## THIS SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY GUARANTEE OF
## PURPOSE AND PERFORMANCE. IN NO EVENT WHATSOEVER SHALL THE
## AUTHOR BE CONSIDERED LIABLE FOR THE USE AND PERFORMANCE OF
## THIS SOFTWARE.
defmodule SitemapController do
def doc_index = DocController.doc_index_sitemap("./doc/")
def page_index = PageController.page_index("./pages/")
def xml = SitemapView.render("https://kc3-lang.org",
doc_index, page_index)
def route = fn (request) {
if ((request.url == "/sitemap.xml") &&
((request.method == HEAD) ||
(request.method == GET))) do
%HTTP.Response{body: SitemapController.xml,
headers: [{"Content-Type", "text/xml"}]}
end
}
end