Make sure ToC is showed in terms, set bookToC to be none by default
This commit is contained in:
@@ -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)
|
||||
}}
|
||||
@@ -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 }}
|
||||
|
||||
@@ -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
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user