geoproject-app/public/site/config/config.php
2026-02-24 19:47:30 +01:00

46 lines
No EOL
960 B
PHP

<?php
use Kirby\Http\Response;
return [
'debug' => true,
'routes' => [
[
'pattern' => '(:all)/web',
'action' => function ($path) {
$realPage = page($path);
if (!$realPage) {
return false;
}
return new Page([
'slug' => $realPage->slug() . '-web',
'template' => 'narrative-web',
// 'content' => $realPage->content()->toArray(),
'content' => array_merge(
$realPage->content()->toArray(),
['originalUri' => $realPage->uri()]
),
]);
}
]
]
// [
// 'pattern' => '(:all)/web',
// 'method' => 'GET',
// 'before' => true,
// 'action' => function (string $path) {
// $page = kirby()->page($path);
// if (!$page) {
// return false;
// }
// return $page->render([], 'narrative-web');
// }
// ]
// ]
];