Add support for TOC partial.

This commit is contained in:
tastytea 2020-12-27 20:08:16 +01:00
parent fdf4359998
commit 2a99951897
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
3 changed files with 7 additions and 0 deletions

View File

@ -7,6 +7,7 @@
:uri-opengraph: http://ogp.me/
:uri-schema: https://schema.org/
:uri-twittercards: https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/abouts-cards.html
:uri-hugo-doc-toc: https://gohugo.io/content-management/toc
:uri-tomorrow-pygments: https://github.com/mozmorris/tomorrow-pygments
*nocolor* is a link:{uri-hugo}[Hugo] theme with no predefined colors and minimal
@ -40,6 +41,9 @@ template `extra-head.html` or above the footer by overwriting
`layouts/partials/extra_head.html` or `layouts/partials/extra_foot.html`,
respectively.
To add a TOC to your pages, add `layouts/partials/toc.html` as described in
link:{uri-hugo-doc-toc}[the Hugo documentation].
If you want source code highlighting, take a look at
link:{uri-tomorrow-pygments}[tomorrow-pygments].

View File

@ -2,5 +2,7 @@
<h1 class="post-title">{{ if .Draft }}DRAFT: {{ end }}{{ .Title }}</h1>
{{ partial "post_meta.html" . }}
{{ partial "toc.html" . }}
<div class="content">{{ .Content }}</div>
{{- end }}

View File

@ -0,0 +1 @@
<!-- You can overwrite this partial to add a TOC. See <https://gohugo.io/content-management/toc>. -->