mirror of
https://github.com/panr/hugo-theme-terminal.git
synced 2024-11-29 15:08:46 +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 }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ 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 }}
|
||||
|
||||
<div class="post-content">
|
||||
|
|
Loading…
Reference in a new issue