world-game/site/templates/article.php
isUnknown 7ba18dcd9d
All checks were successful
Deploy Production / Deploy to Production (push) Successful in 25s
perf : replace loading flash with background preloader, parallel sub-page fetch
- Add #preloader div with scrollable-page-background.png as CSS background,
  matching the Svelte bg-fixed image so the transition is imperceptible
  (image is cached by the time Svelte requests it)
- Revert #ssr-content to visually-hidden (clip) for Google Wave 1 crawl
- Prevent scrollbar flash by adding overflow:hidden to html,body inline
  before main.css loads
- Parallel-fetch sub-page data (/blog/slug.json) alongside parent in initRouter
  so Blog/WhitePapers components receive prefetched data on mount — eliminates
  the list→article flash on direct navigation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 18:05:06 +02:00

44 lines
1.7 KiB
PHP

<?php snippet('header') ?>
<div id="ssr-content">
<?php snippet('ssr/nav') ?>
<main>
<h1><?= $page->title() ?></h1>
<?php if ($page->intro()->isNotEmpty()): ?>
<p><?= $page->intro() ?></p>
<?php endif ?>
<?php if ($page->published()->isNotEmpty()): ?>
<time datetime="<?= $page->published()->toDate('Y-m-d') ?>"><?= $page->published()->toDate('d/m/Y') ?></time>
<?php endif ?>
<?php foreach ($page->body()->toBlocks() as $block): ?>
<?php if ($block->type() === 'text'): ?>
<?= $block->content()->text()->value() ?>
<?php elseif ($block->type() === 'heading'): ?>
<<?= $block->content()->level() ?>><?= $block->content()->text() ?></<?= $block->content()->level() ?>>
<?php elseif ($block->type() === 'quote'): ?>
<blockquote><p><?= $block->content()->text() ?></p></blockquote>
<?php elseif ($block->type() === 'image'): ?>
<?php $imgFile = $block->content()->image()->toFile() ?>
<?php if ($imgFile): ?>
<figure><img src="<?= $imgFile->url() ?>" alt="<?= $block->content()->alt() ?>" /></figure>
<?php endif ?>
<?php endif ?>
<?php endforeach ?>
<?php
$related = $page->relatedArticles()->toPages();
if ($related->isEmpty()) {
$related = $page->siblings()->listed()->not($page)->shuffle()->limit(3);
}
?>
<?php if ($related->isNotEmpty()): ?>
<section>
<h2>Articles liés</h2>
<ul>
<?php foreach ($related as $rel): ?>
<li><?php snippet('ssr/article-card', ['article' => $rel]) ?></li>
<?php endforeach ?>
</ul>
</section>
<?php endif ?>
</main>
</div>
<?php snippet('footer') ?>