add anchors strip

This commit is contained in:
isUnknown 2024-09-04 15:23:45 +02:00
parent 01ebd8ed41
commit a2fd20c1cc
3 changed files with 31 additions and 2 deletions

View file

@ -1,5 +1,22 @@
.anchors-strip {
padding: calc(var(--padding-vertical) / 1.6) var(--space-m) !important;
}
.anchors-strip ul {
display: flex;
}
.anchors-strip a:hover {
text-decoration: underline;
text-underline-offset: 0.3rem;
}
.anchors-strip li {
margin-right: 5vw;
}
[data-template="sectioned"] section {
scroll-margin-top: 6rem;
scroll-margin-top: 8rem;
background-color: var(--color);
}

View file

@ -18,4 +18,4 @@ tabs:
label: Saisons
type: pages
template: season
info: "{{ page.children.count }} événements"
info: "{{ page.children.count }} événements"

View file

@ -1,5 +1,17 @@
<?php snippet('header') ?>
<section class="anchors-strip">
<ul>
<?php foreach($page->children() as $section): ?>
<?php if ($section->isIndexed() != 'false'): ?>
<li>
<a href="#<?= $section->slug() ?>" title="Défiler jusqu'à la section <?= $section->title() ?>"><?= $section->title() ?></a>
</li>
<?php endif ?>
<?php endforeach ?>
</ul>
</section>
<section>
<h1><?= $page->title() ?></h1>
</section>