<?php require_once __DIR__ . '/seo_bootstrap.php'; $index = seo_public_index(); $labels = seo_zone_labels(); $urls = array(); $add = function ($loc, $prio = '0.5') use (&$urls) { $urls[] = array('loc' => $loc, 'prio' => $prio); }; $add(seo_absolute_url('/react/'), '1.0'); foreach (seo_supported_langs() as $lg) { $add(seo_lang_home($lg), '0.9'); foreach (array('about', 'legal', 'privacy') as $p) { $add(seo_static_url($lg, $p), '0.4'); } if (isset($index['by_zone'])) { foreach (array_keys($index['by_zone']) as $zn) { if (isset($labels[$zn])) { $add(seo_absolute_url('/' . $lg . '/zone/' . rawurlencode($zn) . '/'), '0.6'); } } } if (isset($index['by_id'])) { foreach ($index['by_id'] as $spot) { $add(seo_absolute_url('/' . $lg . '/spot/' . rawurlencode($spot['slug']) . '/'), '0.5'); } } } seo_send_indexable_headers('application/xml; charset=UTF-8'); echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n"; foreach ($urls as $u) { echo ' <url><loc>' . htmlspecialchars($u['loc'], ENT_XML1, 'UTF-8') . '</loc><priority>' . $u['prio'] . '</priority></url>' . "\n"; } echo '</urlset>';