This commit is contained in:
isUnknown 2025-02-03 16:32:36 +01:00
parent 1e91353c86
commit fc267d80d1
5 changed files with 110 additions and 51 deletions

View file

@ -1,3 +1,4 @@
<?php
use Kirby\Uuid\Uuid;
@ -5,18 +6,14 @@ use Kirby\Uuid\Uuid;
return [
'pattern' => 'categories/(:any)',
'action' => function ($category) {
$kirby = kirby();
return Page::factory(
[
'slug' => '',
'template' => 'category',
'model' => 'categories',
'content' => [
return Page::factory([
'slug' => Str::slug($category) . '-' . Uuid::generate(),
'template' => 'category',
'model' => 'category',
'content' => [
'title' => $category,
'uuid' => Uuid::generate(),
]
]
);
],
]);
}
];