mirror of
https://github.com/panr/hugo-theme-terminal.git
synced 2025-03-15 02:39:06 +03:00
make Toc a site-wide Param
This commit is contained in:
parent
6ad2d19be8
commit
993f39f58d
1 changed files with 2 additions and 8 deletions
|
@ -28,16 +28,10 @@
|
|||
{{ end }}
|
||||
{{ partial "cover.html" . }}
|
||||
|
||||
{{ if .Params.Toc }}
|
||||
{{ if (.Params.Toc | default .Site.Params.Toc) }}
|
||||
<div class="table-of-contents">
|
||||
<h2>
|
||||
{{ if .Params.TocTitle }}
|
||||
{{ .Params.TocTitle }}
|
||||
{{ else if $.Site.Params.TocTitle }}
|
||||
{{ $.Site.Params.TocTitle }}
|
||||
{{ else }}
|
||||
Table of Contents
|
||||
{{ end }}
|
||||
{{ (.Params.TocTitle | default .Site.Params.TocTitle) | default "Table of Contents" }}
|
||||
</h2>
|
||||
{{ .TableOfContents }}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue