Migration vers architecture Svelte + Kirby inspirée de design-to-pack
- Mise en place de Svelte 4 avec Vite pour le frontend (SPA) - Simplification des templates PHP (header/footer minimalistes) - Création de templates JSON pour API (home, about, expertise, portfolio, jouer, game, blog, article, project) - Ajout d'un controller de site pour définir genericData globalement - Structure des stores Svelte (page, navigation, locale, site) - Router avec navaid pour navigation SPA et interception des liens - Composants layout (Header, Footer, Cursor) et vues de base - Build Vite vers assets/dist/ (index.js/css) - Header PHP détecte assets/dist pour basculer dev/prod Architecture fonctionnelle de base établie, à améliorer et compléter. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
c4456d587c
commit
cbe89acb21
53 changed files with 3348 additions and 772 deletions
32
site/templates/portfolio.json.php
Normal file
32
site/templates/portfolio.json.php
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
$specificData = [
|
||||
'intro' => [
|
||||
'title' => $page->intro_title()->value(),
|
||||
'text' => $page->intro_text()->value()
|
||||
],
|
||||
'projects' => $page->children()->listed()->map(function($project) {
|
||||
return [
|
||||
'title' => $project->title()->value(),
|
||||
'slug' => $project->slug(),
|
||||
'url' => $project->url(),
|
||||
'tagline' => $project->tagline()->value(),
|
||||
'description' => $project->description()->value(),
|
||||
'cover' => $project->cover()->toFile()?->url(),
|
||||
'cover_thumb' => $project->cover()->toFile()?->thumb(['width' => 100])->url(),
|
||||
'gallery' => $project->files()->filterBy('template', 'image')->limit(5)->map(function($img) {
|
||||
return $img->url();
|
||||
})->values(),
|
||||
'impact' => $project->impact()->split(','),
|
||||
'category' => $project->category()->value(),
|
||||
'platforms' => $project->platforms()->split(','),
|
||||
'apple_link' => $project->apple_link()->value(),
|
||||
'android_link' => $project->android_link()->value()
|
||||
];
|
||||
})->values()
|
||||
];
|
||||
|
||||
$pageData = array_merge($genericData, $specificData);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($pageData);
|
||||
Loading…
Add table
Add a link
Reference in a new issue