Make sure ToC is showed in terms, set bookToC to be none by default
This commit is contained in:
@@ -81,10 +81,10 @@ enableGitInfo = true
|
||||
# Theme 'auto' switches between dark and light modes based on browser/os preferences
|
||||
BookTheme = 'light'
|
||||
|
||||
# (Optional, default true) Controls table of contents visibility on right side of pages.
|
||||
# (Optional, default none) Controls table of contents visibility on right side of pages.
|
||||
# Start and end levels can be controlled with markup.tableOfContents setting.
|
||||
# You can also specify this parameter per page in front matter.
|
||||
BookToC = true
|
||||
# BookToC = true
|
||||
|
||||
# (Optional, default favicon.png) Set the path to a favicon file.
|
||||
# If the favicon is /static/favicon.png then the path would be favicon.png
|
||||
|
||||
@@ -69,10 +69,10 @@ params:
|
||||
# Theme 'auto' switches between dark and light modes based on browser/os preferences
|
||||
BookTheme: "light"
|
||||
|
||||
# (Optional, default true) Controls table of contents visibility on right side of pages.
|
||||
# (Optional, default none) Controls table of contents visibility on right side of pages.
|
||||
# Start and end levels can be controlled with markup.tableOfContents setting.
|
||||
# You can also specify this parameter per page in front matter.
|
||||
BookToC: true
|
||||
# BookToC: true
|
||||
|
||||
# (Optional, default favicon.png) Set the path to a favicon file.
|
||||
# If the favicon is /static/favicon.png then the path would be favicon.png
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{ return and
|
||||
(default .Site.Params.BookToC .Params.BookToC | default true)
|
||||
{{ 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