Merge pull request #27 from funayman/add-toc
Add conditional table of contents
This commit is contained in:
commit
565186853e
@ -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…
Reference in New Issue
Block a user