Add support for TOC partial.
This commit is contained in:
parent
fdf4359998
commit
2a99951897
|
@ -7,6 +7,7 @@
|
||||||
:uri-opengraph: http://ogp.me/
|
:uri-opengraph: http://ogp.me/
|
||||||
:uri-schema: https://schema.org/
|
:uri-schema: https://schema.org/
|
||||||
:uri-twittercards: https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/abouts-cards.html
|
: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
|
:uri-tomorrow-pygments: https://github.com/mozmorris/tomorrow-pygments
|
||||||
|
|
||||||
*nocolor* is a link:{uri-hugo}[Hugo] theme with no predefined colors and minimal
|
*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`,
|
`layouts/partials/extra_head.html` or `layouts/partials/extra_foot.html`,
|
||||||
respectively.
|
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
|
If you want source code highlighting, take a look at
|
||||||
link:{uri-tomorrow-pygments}[tomorrow-pygments].
|
link:{uri-tomorrow-pygments}[tomorrow-pygments].
|
||||||
|
|
||||||
|
|
|
@ -2,5 +2,7 @@
|
||||||
<h1 class="post-title">{{ if .Draft }}DRAFT: {{ end }}{{ .Title }}</h1>
|
<h1 class="post-title">{{ if .Draft }}DRAFT: {{ end }}{{ .Title }}</h1>
|
||||||
{{ partial "post_meta.html" . }}
|
{{ partial "post_meta.html" . }}
|
||||||
|
|
||||||
|
{{ partial "toc.html" . }}
|
||||||
|
|
||||||
<div class="content">{{ .Content }}</div>
|
<div class="content">{{ .Content }}</div>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
1
layouts/partials/toc.html
Normal file
1
layouts/partials/toc.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<!-- You can overwrite this partial to add a TOC. See <https://gohugo.io/content-management/toc>. -->
|
Reference in New Issue
Block a user