Skip to content

Commit

Permalink
update pattern matching for robots blueprint
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Möritz <[email protected]>
  • Loading branch information
tobimori authored Mar 5, 2024
1 parent 120a7cf commit 36d0538
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions blueprints/fields/robots.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
];


$path = $kirby->request()->path()->data()[2];
$page = App::instance()->site()->findPageOrDraft(Str::replace($path, '+', '/'));
$path = App::instance()->request()->url()->toString();
$matches = Str::match($path, "/pages\/([a-zA-Z0-9+]+)\/?/m");
$page = App::instance()->site()->findPageOrDraft(Str::replace($matches[1], '+', '/'));

foreach ($kirby->option('tobimori.seo.robots.types') as $robots) {
$upper = Str::ucfirst($robots);
Expand Down

0 comments on commit 36d0538

Please sign in to comment.