Merge pull request #27 from funayman/add-toc

Add conditional table of contents
This commit is contained in:
Radek Kozieł 2020-05-28 18:32:33 +02:00 committed by GitHub
commit 565186853e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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">