<?php
require_once __DIR__ . '/includes/site.php';
header('Content-Type: application/xml; charset=utf-8');
$today = date('Y-m-d');
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
?>
<urlset xmlns="<?= e(sitemap_namespace()) ?>">
<?php foreach (page_paths() as $path): ?>
  <url>
    <loc><?= e(current_url($path)) ?></loc>
    <lastmod><?= e($today) ?></lastmod>
    <changefreq><?= $path === '/' ? 'daily' : 'weekly' ?></changefreq>
    <priority><?= $path === '/' ? '1.0' : '0.8' ?></priority>
  </url>
<?php endforeach; ?>
</urlset>
