investigation-summary : rendu des layouts avec blocs

- Création des snippets de blocs (text, heading, image)
- Implémentation du rendu des layouts avec colonnes
- Structure en grille pour layouts multi-colonnes

NOTE : Cette implémentation est à revoir selon la maquette finale.
Le rendu actuel utilise une structure basique en attendant les spécifications de design.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
antonin gallon 2026-01-07 17:50:44 +01:00
parent 4a18a61148
commit d9409e689a
4 changed files with 22 additions and 1 deletions

View file

@ -0,0 +1,4 @@
<?php
$level = $block->level()->or('h2');
?>
<<?= $level ?>><?= $block->text() ?></<?= $level ?>>

View file

@ -0,0 +1,8 @@
<?php if ($image = $block->image()->toFile()): ?>
<figure>
<img src="<?= $image->url() ?>" alt="<?= $block->alt()->or($image->alt()) ?>">
<?php if ($block->caption()->isNotEmpty()): ?>
<figcaption><?= $block->caption() ?></figcaption>
<?php endif; ?>
</figure>
<?php endif; ?>

View file

@ -0,0 +1 @@
<?= $block->text() ?>

View file

@ -120,7 +120,15 @@
<?php if ($page->body()->isNotEmpty()): ?>
<div class="section__article" id="section__synthese">
<h3 class="section__title">Synthèse</h3>
<?= $page->body()->toLayouts() ?>
<?php foreach ($page->body()->toLayouts() as $layout): ?>
<div class="grid" data-columns="<?= $layout->columns()->count() ?>">
<?php foreach ($layout->columns() as $column): ?>
<div class="column" style="--columns: <?= $column->span() ?>">
<?= $column->blocks() ?>
</div>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>