implémentation de la toc complete pour linear
This commit is contained in:
parent
0de3b29e8b
commit
d51fc592ed
10 changed files with 125 additions and 33 deletions
|
|
@ -8,7 +8,7 @@ $isOpen ??= false;
|
|||
<?= $slots->title() ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php if ($page->parent()->parent()->is('textes')){
|
||||
<?php if ($page->parent() && $page->parent()->parent()->is('textes')){
|
||||
snippet('toc', ["content" => $page->bodyBlocks()->toBlocks()]);
|
||||
} ?>
|
||||
<?php if ($slots->text()): ?>
|
||||
|
|
|
|||
|
|
@ -2,9 +2,14 @@
|
|||
<?php if (!$page->is(page('lettre')) && !$page->is(page('a-propos'))): ?>
|
||||
<footer id="main-footer">
|
||||
<ul id="links">
|
||||
<li class="open-nav-wrapper hidden">
|
||||
<button class="plus open-nav" title="chercher parmi les textes">textes</button>
|
||||
<li class="open-nav-wrapper open-nav-wrapper_text hidden">
|
||||
<button class="plus open-nav open-nav_text" title="chercher parmi les textes">textes</button>
|
||||
</li>
|
||||
<?php if ($page->parent() && $page->parent()->parent()->is('textes')): ?>
|
||||
<li class="open-nav-wrapper open-nav-wrapper_toc hidden if_toc">
|
||||
<button class="plus open-nav open-nav_toc" title="ouvrir le sommaire">sommaire</button>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
<li>
|
||||
<a href="/lettre" id="subscribe-btn" class="plus">
|
||||
s'inscrire
|
||||
|
|
|
|||
|
|
@ -84,6 +84,13 @@ $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-template="<?= $page->template() ?>">
|
||||
<button class="theme-toggler" data-theme-toggler>
|
||||
<span class="theme-toggler-icon"></span>
|
||||
|
|
@ -99,4 +106,9 @@ $entryTopPos ??= 20;
|
|||
</h1>
|
||||
</a>
|
||||
</header>
|
||||
<?php snippet('nav') ?>
|
||||
<?php snippet('nav') ?>
|
||||
<?php if ($page->parent() && $page->parent()->parent()->is('textes')){
|
||||
snippet('panel-toc');
|
||||
}
|
||||
?>
|
||||
<div id="nav-overlay"></div>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<nav class="panel" x-data="{search: ''}">
|
||||
<nav class="panel panel-text" x-data="{search: ''}">
|
||||
<header>
|
||||
<p class="sort-btns">
|
||||
<button class="sort-btn sort-btn--years active">années</span></button>
|
||||
|
|
@ -19,5 +19,4 @@
|
|||
<?php snippet('nav__texts--collection', ['collection' => 'categories']) ?>
|
||||
<?php snippet('nav__texts--collection', ['collection' => 'years']) ?>
|
||||
<button class="less panel-close">textes</button>
|
||||
</nav>
|
||||
<div id="nav-overlay"></div>
|
||||
</nav>
|
||||
6
site/snippets/panel-toc.php
Normal file
6
site/snippets/panel-toc.php
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<div class="panel panel-toc" x-data="{search: ''}">
|
||||
<?php
|
||||
snippet('toc', ["content" => $page->bodyBlocks()->toBlocks()]);
|
||||
?>
|
||||
<button class="less panel-close">sommaire</button>
|
||||
</div>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<nav class="toc">
|
||||
<div class="light toc_label">Sommaire</div>
|
||||
<div class="light toc_label if_toc">Sommaire</div>
|
||||
<ul>
|
||||
<?php
|
||||
preg_match_all('/<h3>(.*?)<\/h3>/', $content, $titres);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue