<?php
require __DIR__ . '/includes/functions.php';
header('Content-Type: application/xml; charset=utf-8');
$paths = [
    '/',
    '/news/video-trend/',
    '/observe/mobile-video/',
    '/topic/week/',
    '/columns/',
    '/authors/',
    '/about/',
    '/contact/',
    '/data/'
];
$ns = 'http://' . 'www.sitemaps' . '.org/schemas/sitemap/0.9';
echo '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL;
echo '<urlset xmlns="' . h($ns) . '">' . PHP_EOL;
foreach ($paths as $path) {
    echo "  <url>\n";
    echo '    <loc>' . h(absolute_url($path)) . "</loc>\n";
    echo '    <lastmod>' . date('Y-m-d') . "</lastmod>\n";
    echo "    <changefreq>daily</changefreq>\n";
    echo "    <priority>" . ($path === '/' ? '1.0' : '0.8') . "</priority>\n";
    echo "  </url>\n";
}
echo '</urlset>' . PHP_EOL;
