Feat: Livres blancs — nouveau template collection + livre blanc individuel

- Blueprints white-papers / white-paper (intro, cover, PDF, date)
- Templates PHP + JSON API (liste avec singleSlug, détail avec fileUrl)
- Route POST (:any)/(:any)/download pour le téléchargement gated
- Panel : entrée white-papers ajoutée au menu après blog
- collection.css : styles partagés extraits de Blog (collection-*)
- Blog.svelte : classes renommées blog-* → collection-*
- WhitePapers.svelte : vue liste, URLs dynamiques via data.uri
- WhitePaper.svelte : vue détail deux colonnes + formulaire de téléchargement
- i18n : clés white paper (label, form, consentement, statuts)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-03-18 17:37:22 +01:00
parent 42ee58c18d
commit d4f05d6157
17 changed files with 870 additions and 183 deletions

View file

@ -11,4 +11,27 @@ return [
],
'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;
}
]
],
];

View file

@ -29,7 +29,8 @@ return [
'portfolio' => menuItem('portfolio', 'Portfolio','images', 'pages/portfolio'),
'jouer' => menuItem('jouer', 'Jouer', 'play', 'pages/jouer'),
'a-propos' => menuItem('a-propos', 'À propos', 'users', 'pages/a-propos'),
'blog' => menuItem('blog', 'Blog', 'text', 'pages/blog'),
'blog' => menuItem('blog', 'Blog', 'text', 'pages/blog'),
'white-papers' => menuItem('livres-blancs', 'Livres blancs', 'book', 'pages/livres-blancs'),
'-',
'users',
'system',