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>
28 lines
729 B
PHP
28 lines
729 B
PHP
<?php
|
|
|
|
$bodyBlocks = [];
|
|
foreach ($page->body()->toBlocks() as $block) {
|
|
if ($block->type() === 'text') {
|
|
$bodyBlocks[] = [
|
|
'type' => 'text',
|
|
'html' => $block->content()->text()->value()
|
|
];
|
|
}
|
|
}
|
|
|
|
$specificData = [
|
|
'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);
|
|
|
|
header('Content-Type: application/json');
|
|
echo json_encode($pageData);
|