mirror of
https://github.com/thomasjsn/hugo-theme-hello-friend.git
synced 2024-11-14 12:25:07 +01:00
Merge pull request #141 from aormsby/PR-toc
Add basic Table of Contents for posts
This commit is contained in:
commit
ecf77d7031
@ -96,6 +96,10 @@ paginate = 5
|
||||
# Show reading time in minutes for posts
|
||||
showReadingTime = false
|
||||
|
||||
# Show table of contents at the top of your posts (defaults to false)
|
||||
# Alternatively, add this param to post front matter for specific posts
|
||||
toc = true
|
||||
|
||||
[languages]
|
||||
[languages.en]
|
||||
title = "Hello Friend"
|
||||
|
@ -40,6 +40,10 @@
|
||||
{{ end }}
|
||||
|
||||
<div class="post-content">
|
||||
{{ if or .Params.Toc $.Site.Params.Toc }}
|
||||
<h2>Table of Contents</h2>
|
||||
<aside class="table-of-contents">{{ .TableOfContents }}</aside>
|
||||
{{ end }}
|
||||
{{ .Content }}
|
||||
</div>
|
||||
{{ if eq .Type $.Site.Params.contentTypeName }}
|
||||
|
Loading…
Reference in New Issue
Block a user