Add default TOC template.
This commit is contained in:
parent
2dfa7a6f78
commit
c7884a8b80
10
README.adoc
10
README.adoc
|
@ -41,10 +41,14 @@ 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].
|
||||||
|
|
||||||
|
== Good to know
|
||||||
|
|
||||||
|
Table of contents are only written when the word count exceeds 400 and the `toc`
|
||||||
|
field in your content’s front matter is set to true. See
|
||||||
|
link:{uri-hugo-doc-toc}[the Hugo documentation] for details. You can overwrite
|
||||||
|
the template by adding the file `layouts/partials/toc.html` to your blog.
|
||||||
|
|
||||||
include::{uri-base}/raw/branch/main/CONTRIBUTING.adoc[]
|
include::{uri-base}/raw/branch/main/CONTRIBUTING.adoc[]
|
||||||
|
|
|
@ -1 +1,8 @@
|
||||||
<!-- You can overwrite this partial to add a TOC. See <https://gohugo.io/content-management/toc>. -->
|
{{ if and (gt .WordCount 400 ) (.Params.toc) }}
|
||||||
|
<aside class="toc">
|
||||||
|
<header>
|
||||||
|
<h2>Table of contents</h2>
|
||||||
|
</header>
|
||||||
|
{{.TableOfContents}}
|
||||||
|
</aside>
|
||||||
|
{{ end }}
|
||||||
|
|
|
@ -129,12 +129,6 @@ div.admonitionblock td
|
||||||
margin-top: 2em;
|
margin-top: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Table of contents */
|
|
||||||
#toc ul
|
|
||||||
{
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
textarea, pre
|
textarea, pre
|
||||||
{
|
{
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
Loading…
Reference in New Issue