Create sitemap

This commit is contained in:
Bruno Rybársky 2024-02-15 10:41:48 +01:00
parent e37387f084
commit 3344d7412c
2 changed files with 4 additions and 3 deletions

@ -20,7 +20,7 @@ if (!isLoggedIn()) {
if($routerRequest["site_name"] == "sitemap.xml") {
require "lib/sitemap.php";
echo generateSitemap();
generateSitemap();
exit();
}

@ -2,7 +2,7 @@
require_once "lib/account.php";
function generateSitemap(): string {
function generateSitemap(): void{
global $routerConfig;
$site_dirs = array_diff(scandir($routerConfig["page_dir"]), array('.', '..'));
@ -52,5 +52,6 @@ function generateSitemap(): string {
$sitemap .= '</urlset>' . PHP_EOL;
return $sitemap;
header('Content-type: application/xml');
echo $sitemap;
}