add ext-sitemap
This commit is contained in:
@@ -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>');
|
||||
Reference in New Issue
Block a user