Feat: page À propos — redesign complet avec carrousel équipe
All checks were successful
Deploy / Deploy to Production (push) Successful in 5m23s
All checks were successful
Deploy / Deploy to Production (push) Successful in 5m23s
- Fix about.json.php : lecture des vrais champs Kirby (intro writer, body blocks, files template member) — corrige le bug [object Object] - About.svelte : redesign fidèle à la source (intro centrée, blocs mission/manifeste avec bordure verte, carrousel équipe horizontal 3/2/1 items selon breakpoint, swipe tactile, prev/next + pagination) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
773be2840c
commit
61607f8cd7
3 changed files with 374 additions and 163 deletions
|
|
@ -1,31 +1,25 @@
|
|||
<?php
|
||||
|
||||
$bodyBlocks = [];
|
||||
foreach ($page->body()->toBlocks() as $block) {
|
||||
if ($block->type() === 'text') {
|
||||
$bodyBlocks[] = [
|
||||
'type' => 'text',
|
||||
'html' => $block->content()->text()->value()
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$specificData = [
|
||||
'intro' => [
|
||||
'title' => $page->introTitle()->value(),
|
||||
'text' => $page->introText()->value()
|
||||
],
|
||||
'mission' => [
|
||||
'title' => $page->missionTitle()->value(),
|
||||
'text' => $page->missionText()->toBlocks()
|
||||
],
|
||||
'manifesto' => [
|
||||
'title' => $page->manifestoTitle()->value(),
|
||||
'text' => $page->manifestoText()->toBlocks()
|
||||
],
|
||||
'team' => [
|
||||
'title' => $page->teamTitle()->value(),
|
||||
'members' => $page->teamMembers()->toStructure()->map(function($member) {
|
||||
return [
|
||||
'name' => $member->name()->value(),
|
||||
'role' => $member->role()->value(),
|
||||
'bio' => $member->bio()->value(),
|
||||
'photo' => $member->photo()->toFile()?->url(),
|
||||
'linkedin' => $member->linkedin()->value(),
|
||||
'twitter' => $member->twitter()->value()
|
||||
];
|
||||
'intro' => $page->intro()->value(),
|
||||
'body' => $bodyBlocks,
|
||||
'team' => $page->files()->template('member')->sort('sort')->map(function ($file) {
|
||||
return [
|
||||
'name' => $file->memberName()->value(),
|
||||
'role' => $file->role()->value(),
|
||||
'photo' => $file->url(),
|
||||
];
|
||||
})->values()
|
||||
]
|
||||
];
|
||||
|
||||
$pageData = array_merge($genericData, $specificData);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue