apropos: dynamic TOC via extractToc, HeadingPermalinkExtension, debug logging for TOC diagnosis

This commit is contained in:
Pontoporeia
2026-07-10 15:07:14 +02:00
parent 2461f526bf
commit 018d699ebd
6 changed files with 52 additions and 8 deletions
+5 -5
View File
@@ -34,14 +34,13 @@ function renderEntries(array $entries): string
<main class="page-content" id="main-content">
<!-- Table of contents: collapsible on mobile, force-open on desktop -->
<?php if (!empty($tocItems)): ?>
<details class="toc">
<summary><?= icon('caret-down', 0, 'toc-caret') ?> PARTIES</summary>
<ul class="toc-list">
<li><a href="#apropos-intro">À propos</a></li>
<?php if (!empty($contacts)): ?>
<li><a href="#apropos-contacts">Contacts</a></li>
<?php endif; ?>
<li><a href="#apropos-credits">Crédits</a></li>
<?php foreach ($tocItems as $item): ?>
<li class="toc-level-<?= $item['level'] ?? 1 ?>"><a href="<?= htmlspecialchars($item['href']) ?>"><?= htmlspecialchars($item['label']) ?></a></li>
<?php endforeach; ?>
</ul>
<?php if (!empty($sidebarLinks)): ?>
<?php foreach ($sidebarLinks as $sl): ?>
@@ -53,6 +52,7 @@ function renderEntries(array $entries): string
<?php endforeach; ?>
<?php endif; ?>
</details>
<?php endif; ?>
<article>
<!-- Intro text from DB -->