mirror of
https://github.com/YGGverse/YGGwave.git
synced 2025-02-07 20:34:16 +00:00
add sitemap
This commit is contained in:
parent
e47434f98d
commit
6144699c99
3
robots.txt
Normal file
3
robots.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
User-agent: *
|
||||||
|
|
||||||
|
Sitemap: /sitemap.php
|
25
sitemap.php
Normal file
25
sitemap.php
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
header('Content-type: application/xml; charset=utf-8');
|
||||||
|
|
||||||
|
echo '<?xml version="1.0" encoding="UTF-8"?>';
|
||||||
|
echo '<urlset>';
|
||||||
|
|
||||||
|
if ($signals = file_get_contents('SIGNALS/YGGDRASIL.md')) {
|
||||||
|
|
||||||
|
foreach (explode(PHP_EOL, $signals) as $signal) {
|
||||||
|
|
||||||
|
if (preg_match('/\[(.*?)\]\((.*?)\)/ui', $signal, $data)) {
|
||||||
|
|
||||||
|
if (!empty($data[1]) && !empty($data[2])) {
|
||||||
|
|
||||||
|
if ($host = parse_url($data[2], PHP_URL_HOST)) {
|
||||||
|
|
||||||
|
echo sprintf('<url><loc>%s</loc></url>', htmlentities($data[2]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '</urlset>';
|
Loading…
x
Reference in New Issue
Block a user