diff --git a/robots.txt b/robots.txt index f1c2773..22a08ce 100644 --- a/robots.txt +++ b/robots.txt @@ -1,23 +1,11 @@ User-agent: * Allow: / -# Spezielle Erlaubnis für DSGVO/Legal Scanner -User-agent: LegalCockpitBot -Allow: / - -User-agent: CookieBot -Allow: / - -User-agent: DataProtectionBot -Allow: / - -User-agent: GDPRBot -Allow: / - # Sitemap (falls vorhanden) -# Sitemap: https://www.schachfreunde-badsteben.de/sitemap.xml +https://www.schachfreunde-badsteben.de/sitemap.xml # Wichtige Seiten explizit erlauben Allow: /datenschutz Allow: /impressum -Allow: /kontakt \ No newline at end of file +Allow: /kontakt +Allow: /home \ No newline at end of file diff --git a/site/config/config.php b/site/config/config.php index 6add258..95b10d4 100644 --- a/site/config/config.php +++ b/site/config/config.php @@ -7,23 +7,27 @@ return [ 'compiler' => false ] ], - - // Bessere Scanner-Kompatibilität - 'cache' => [ - 'pages' => [ - 'active' => true + 'routes' => [ + [ + 'pattern' => 'sitemap.xml', + 'action' => function() { + $pages = site()->pages()->index(); + + // fetch the pages to ignore from the config settings, + // if nothing is set, we ignore the error page + $ignore = kirby()->option('sitemap.ignore', ['error']); + + $content = snippet('sitemap', compact('pages', 'ignore'), true); + + // return response with correct header type + return new Kirby\Cms\Response($content, 'application/xml'); + } + ], + [ + 'pattern' => 'sitemap', + 'action' => function() { + return go('sitemap.xml', 301); + } ] ], - - // Headers für bessere Scanner-Kompatibilität - 'headers' => [ - 'X-Frame-Options' => 'SAMEORIGIN', - 'X-XSS-Protection' => '1; mode=block' - ], - - // Robots-freundliche Einstellungen - 'smartypants' => true, - 'markdown' => [ - 'extra' => true - ] ]; diff --git a/site/snippets/sitemap.php b/site/snippets/sitemap.php new file mode 100644 index 0000000..9510636 --- /dev/null +++ b/site/snippets/sitemap.php @@ -0,0 +1,11 @@ +'; ?> + + + uri(), $ignore)) continue ?> + + url()) ?> + modified('c', 'date') ?> + isHomePage()) ? 1 : number_format(0.5 / $p->depth(), 1) ?> + + + \ No newline at end of file