2022-11-20 20:03:01 -06:00
|
|
|
<?php
|
2022-07-02 10:24:10 -05:00
|
|
|
|
2022-11-20 20:03:01 -06:00
|
|
|
/*
|
2022-07-02 10:24:10 -05:00
|
|
|
* Build a sitemap dynamically.
|
|
|
|
* Update Gitea's sitemap with: `php ./sitemap.php > /var/lib/gitea/custom/sitemap.xml`
|
|
|
|
*
|
|
|
|
* Builds according to https://www.sitemaps.org/protocol.html
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Globals */
|
|
|
|
$path="/srv/http/aninix.net/";
|
|
|
|
|
|
|
|
echo '<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
|
|
';
|
|
|
|
|
2023-02-20 16:50:10 -06:00
|
|
|
exec("(echo /srv/http/aninix.net/index.php; find /srv/http/aninix.net/pages -type f; find /srv/http/aninix.net/martialarts/ -type f) | grep -E \.php\$ | grep -vE ^./unlisted\|^./errors/\|head.php\|foot.php\|test\|Template\|darknet", $output);
|
2022-11-20 20:03:01 -06:00
|
|
|
foreach ($output as &$file) {
|
2022-07-02 10:24:10 -05:00
|
|
|
echo ' <url>
|
|
|
|
';
|
|
|
|
echo ' <loc>https://aninix.net/'.substr($file,strlen($path)).'</loc>
|
|
|
|
';
|
|
|
|
echo ' <lastmod>'.date('Y-m-d',filemtime($file)).'</lastmod>
|
|
|
|
';
|
|
|
|
echo ' </url>
|
2022-11-20 20:03:01 -06:00
|
|
|
';
|
2022-07-02 10:24:10 -05:00
|
|
|
}
|
|
|
|
|
2022-11-20 20:03:01 -06:00
|
|
|
/* Print footer */
|
2022-07-02 10:24:10 -05:00
|
|
|
echo '</urlset>
|
|
|
|
';
|
|
|
|
?>
|