mirror of
https://github.com/panr/hugo-theme-terminal.git
synced 2025-04-03 11:43:30 +03:00
Merge pull request #27 from funayman/add-toc
Add conditional table of contents
This commit is contained in:
commit
565186853e
1 changed files with 17 additions and 2 deletions
|
@ -22,9 +22,24 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</span>
|
</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ with .Params.Cover }}
|
{{ with .Params.Cover }}
|
||||||
<img src="{{ . | absURL }}" class="post-cover" />
|
<img src="{{ . | absURL }}" class="post-cover" />
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if .Params.Toc }}
|
||||||
|
<div class="table-of-contents">
|
||||||
|
<h1>
|
||||||
|
{{ if .Params.TocTitle }}
|
||||||
|
{{ .Params.TocTitle }}
|
||||||
|
{{ else if $.Site.Params.TocTitle }}
|
||||||
|
{{ $.Site.Params.TocTitle }}
|
||||||
|
{{ else }}
|
||||||
|
Table of Contents
|
||||||
|
{{ end }}
|
||||||
|
</h1>
|
||||||
|
{{ .TableOfContents }}
|
||||||
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
|
|
Loading…
Add table
Reference in a new issue