<?php
require_once __DIR__ . '/inc/config.php';
header('Content-Type: application/xml; charset=utf-8');
$paths = ['/', '/news/', '/observe/', '/topics/', '/authors/', '/faq/', '/contact/', '/video-guide/', '/latest-entry/', '/creator-workflow/'];
$ns = 'http://www.sitemaps' . '.org/schemas/sitemap/0.9';
echo '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL;
echo '<urlset xmlns="' . e($ns) . '">' . PHP_EOL;
foreach ($paths as $path) {
    echo '  <url>' . PHP_EOL;
    echo '    <loc>' . e(canonical_url($path)) . '</loc>' . PHP_EOL;
    echo '    <lastmod>' . e(iso_today()) . '</lastmod>' . PHP_EOL;
    echo '    <changefreq>daily</changefreq>' . PHP_EOL;
    echo '    <priority>' . ($path === '/' ? '1.0' : '0.8') . '</priority>' . PHP_EOL;
    echo '  </url>' . PHP_EOL;
}
echo '</urlset>' . PHP_EOL;
?>
