From 6144699c992a28f36be37ce5d25eb73d84ad4c68 Mon Sep 17 00:00:00 2001 From: ghost Date: Fri, 28 Jul 2023 13:07:22 +0300 Subject: [PATCH] add sitemap --- robots.txt | 3 +++ sitemap.php | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 robots.txt create mode 100644 sitemap.php diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..9bebb49 --- /dev/null +++ b/robots.txt @@ -0,0 +1,3 @@ +User-agent: * + +Sitemap: /sitemap.php \ No newline at end of file diff --git a/sitemap.php b/sitemap.php new file mode 100644 index 0000000..314fa4a --- /dev/null +++ b/sitemap.php @@ -0,0 +1,25 @@ +'; +echo ''; + +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('%s', htmlentities($data[2])); + } + } + } + } +} + +echo ''; \ No newline at end of file