make Toc a site-wide Param

This commit is contained in:
icy-comet 2022-02-05 15:58:12 +05:30
parent 6ad2d19be8
commit 993f39f58d

View File

@ -28,16 +28,10 @@
{{ end }} {{ end }}
{{ partial "cover.html" . }} {{ partial "cover.html" . }}
{{ if .Params.Toc }} {{ if (.Params.Toc | default .Site.Params.Toc) }}
<div class="table-of-contents"> <div class="table-of-contents">
<h2> <h2>
{{ if .Params.TocTitle }} {{ (.Params.TocTitle | default .Site.Params.TocTitle) | default "Table of Contents" }}
{{ .Params.TocTitle }}
{{ else if $.Site.Params.TocTitle }}
{{ $.Site.Params.TocTitle }}
{{ else }}
Table of Contents
{{ end }}
</h2> </h2>
{{ .TableOfContents }} {{ .TableOfContents }}
</div> </div>