mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-08-10 15:21:22 +02:00
apropos: dynamic TOC via extractToc, HeadingPermalinkExtension, debug logging for TOC diagnosis
This commit is contained in:
@@ -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 -->
|
||||
|
||||
Reference in New Issue
Block a user