Make sure ToC is showed in terms, set bookToC to be none by default

This commit is contained in:
Alex Shpak
2025-09-10 06:43:58 +02:00
parent ac32260c64
commit 3d55d45223
6 changed files with 25 additions and 22 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
{{ return and
(default .Site.Params.BookToC .Params.BookToC | default true)
(not (eq .TableOfContents "<nav id=\"TableOfContents\"></nav>"))
{{ return default
(not (eq .TableOfContents "<nav id=\"TableOfContents\"></nav>"))
(default .Site.Params.BookToC .Params.BookToC)
}}
+8
View File
@@ -14,6 +14,14 @@
{{ template "_internal/pagination.html" . }}
{{ end }}
{{ define "toc-container" }}
<aside class="book-toc">
<div class="book-toc-content">
{{ template "toc" . }}
</div>
</aside>
{{ end }}
{{ define "toc" }}
{{ partial "docs/taxonomy" . }}
{{ end }}
-13
View File
@@ -1,13 +0,0 @@
{{ define "main" }}
<article class="markdown book-post">
<h1>{{ .Title | title }}</h1>
{{ $taxonomies := index .Site.Taxonomies .Page.Type }}
{{ range $taxonomies }}
<div><a href="{{ .Page.Permalink }}">{{ .Page.Title }} <sup>{{ .Count }}</sup></a></div>
{{ end }}
</article>
{{ end }}
{{ define "toc" }}
{{ partial "docs/taxonomy" . }}
{{ end }}
+10 -2
View File
@@ -5,15 +5,23 @@
<a href="{{ .RelPermalink }}">{{ partial "docs/title.html" . }}</a>
</h2>
{{ partial "docs/post-meta" . }}
<p>
<div class="book-post-content">
{{- .Summary -}}
</p>
</div>
</article>
{{ end }}
{{ template "_internal/pagination.html" . }}
{{ end }}
{{ define "toc-container" }}
<aside class="book-toc">
<div class="book-toc-content">
{{ template "toc" . }}
</div>
</aside>
{{ end }}
{{ define "toc" }}
{{ partial "docs/taxonomy" . }}
{{ end }}