add ext-sitemap

This commit is contained in:
2026-11-22 16:26:35 +01:00
parent 932c7d21fe
commit 671b7999e7
4 changed files with 53 additions and 0 deletions
@@ -0,0 +1,16 @@
<?php
use Plugi\Repositories\PageTranslationRepository;
print('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">');
foreach ((new PageTranslationRepository)->getAll(['route','updated_at']) as $sitemaproute) {
if($sitemaproute->route === '/sitemap.xml') continue;
print('
<url>
<loc>'. $_ENV['BASE_URL'] . $sitemaproute->route .'</loc>
<lastmod>' . $sitemaproute->updated_at .'</lastmod>
<changefreq>weekly</changefreq>
<priority>' . ($sitemaproute->route === '/' ? '1.00' : '0.50') .'</priority>
</url>
');
}
print('</urlset>');