From 4759b1577e595c4d3648ee35b8646e360e1239ab Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Wed, 25 Jul 2018 22:55:30 +0200 Subject: [PATCH] Add basic sitemap --- blog.php | 9 +++++++++ sitemap.php | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 sitemap.php diff --git a/blog.php b/blog.php index 311503a..41c7a52 100644 --- a/blog.php +++ b/blog.php @@ -219,6 +219,15 @@ apcu_store('posts', $posts, CACHE_POSTS_TTL); $CMS_INDEXING = false; } + + if (isset($CMS_SITEMAP)) { + foreach($posts as $k=>$v) { + if ($v->isPublic) { + echo "\n\t" . htmlspecialchars($v->permalink) . "\n\n"; + } + } + return; + } if (!isset($CMS_RSS)) diff --git a/sitemap.php b/sitemap.php new file mode 100644 index 0000000..5dabd5e --- /dev/null +++ b/sitemap.php @@ -0,0 +1,24 @@ + + + +\n\t" . htmlspecialchars($url) . "\n\n"; + } + require "blog.php"; +?> + +