<?php

declare(strict_types=1);

header('Content-Type: application/xml; charset=UTF-8');

$base     = 'https://nhl4.com';
$lastmod  = date('Y-m-d');

$urls = [
    [
        'loc'        => $base . '/',
        'lastmod'    => $lastmod,
        'changefreq' => 'weekly',
        'priority'   => '1.0',
    ],
    [
        'loc'        => $base . '/#videos',
        'lastmod'    => $lastmod,
        'changefreq' => 'weekly',
        'priority'   => '0.9',
    ],
    [
        'loc'        => $base . '/#mocs',
        'lastmod'    => $lastmod,
        'changefreq' => 'monthly',
        'priority'   => '0.8',
    ],
    [
        'loc'        => $base . '/#shorts',
        'lastmod'    => $lastmod,
        'changefreq' => 'weekly',
        'priority'   => '0.7',
    ],
    [
        'loc'        => $base . '/#about',
        'lastmod'    => $lastmod,
        'changefreq' => 'yearly',
        'priority'   => '0.5',
    ],
];

echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<?php foreach ($urls as $url): ?>
    <url>
        <loc><?= htmlspecialchars($url['loc'], ENT_XML1, 'UTF-8') ?></loc>
        <lastmod><?= htmlspecialchars($url['lastmod'], ENT_XML1, 'UTF-8') ?></lastmod>
        <changefreq><?= htmlspecialchars($url['changefreq'], ENT_XML1, 'UTF-8') ?></changefreq>
        <priority><?= htmlspecialchars($url['priority'], ENT_XML1, 'UTF-8') ?></priority>
    </url>
<?php endforeach ?>
</urlset>
