refactoring avec claude + ajout scroll-margin-top et désaffichage du panel au click sur les liens du toc

This commit is contained in:
antonin gallon 2026-02-17 18:10:04 +01:00
parent d51fc592ed
commit 01c5b098e4
14 changed files with 149 additions and 121 deletions

View file

@ -84,13 +84,7 @@ $entryTopPos ??= 20;
<body
class="background-grid <?= e($page->fullWidth() == 'true', 'full-width') ?>"
data-is_toc="<?php
if ($page->bodyBlocks() && $page->bodyBlocks()->isNotEmpty() && preg_match('/<h3>(.*?)<\/h3>/', $page->bodyBlocks())){
echo "true";
}else{
echo "false";
}
?>"
data-has-toc="<?= $page->hasToc() ? 'true' : 'false' ?>"
data-template="<?= $page->template() ?>">
<button class="theme-toggler" data-theme-toggler>
<span class="theme-toggler-icon"></span>
@ -107,8 +101,7 @@ $entryTopPos ??= 20;
</a>
</header>
<?php snippet('nav') ?>
<?php if ($page->parent() && $page->parent()->parent()->is('textes')){
snippet('panel-toc');
}
?>
<?php if ($page->hasToc()): ?>
<?php snippet('panel-toc') ?>
<?php endif ?>
<div id="nav-overlay"></div>