true, 'languages' => true, 'panel' => [ 'css' => 'assets/css/custom-panel.css', 'theme' => 'dark', 'menu' => require __DIR__ . '/menu.php', ], 'thumbs' => require __DIR__ . '/thumbs.php', 'routes' => [ [ 'pattern' => ['(:any)/(:any)/download', 'en/(:any)/(:any)/download'], 'method' => 'POST', 'action' => function (string $parent, string $slug) { $page = kirby()->page($parent . '/' . $slug); if (!$page || $page->intendedTemplate()->name() !== 'white-paper') { http_response_code(404); header('Content-Type: application/json'); echo json_encode(['error' => 'Not found']); exit; } // TODO: store/email form data ($kirby->request()->body()) header('Content-Type: application/json'); echo json_encode([ 'success' => true, 'fileUrl' => $page->downloadFile()->toFile()?->url(), ]); exit; } ] ], ];