<?php
header('Content-Type: application/xml; charset=utf-8');
// 固定 canonical 域名，避免非 www 或 http 被写入 sitemap
$base = 'https://www.sytlzx.com';
$today = date('Y-m-d');
$pages = [
    ['file' => '', 'priority' => '1.0', 'freq' => 'weekly'],
    ['file' => 'yanxue.html', 'priority' => '0.9', 'freq' => 'weekly'],
    ['file' => 'chuzhong.html', 'priority' => '0.9', 'freq' => 'weekly'],
    ['file' => 'xiaoxue.html', 'priority' => '0.9', 'freq' => 'weekly'],
    ['file' => 'hunyin.html', 'priority' => '0.8', 'freq' => 'weekly'],
    ['file' => 'articles/', 'priority' => '0.8', 'freq' => 'weekly'],
    ['file' => 'articles/haizi-bu-shangxue.html', 'priority' => '0.7', 'freq' => 'monthly'],
    ['file' => 'articles/xiuxue-xueji.html', 'priority' => '0.7', 'freq' => 'monthly'],
    ['file' => 'articles/chuzhong-panni.html', 'priority' => '0.7', 'freq' => 'monthly'],
    ['file' => 'articles/kaoqian-jiaolv.html', 'priority' => '0.7', 'freq' => 'monthly'],
];
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<?php foreach ($pages as $page): ?>
  <url>
    <loc><?php echo htmlspecialchars($base . '/' . $page['file'], ENT_XML1, 'UTF-8'); ?></loc>
    <lastmod><?php echo $today; ?></lastmod>
    <changefreq><?php echo $page['freq']; ?></changefreq>
    <priority><?php echo $page['priority']; ?></priority>
  </url>
<?php endforeach; ?>
</urlset>
