hugo/docs/content/extras/toc.md
Anthony Fok ba44e860a3 [Docs] Copyediting
* Add meta author, description and generator tags
 * Add Hugo version beside the logo and in the footer
 * Suggest the user to run `go get -u -v` to update dependencies
 * Requires Go 1.3+ rather than Go 1.1+
 * Improve rendering/formatting in some places
 * Add trailing slash to URLs where appropriate
 * GitHub redirects all http requests to https, update accordingly
2015-01-28 18:02:40 -07:00

834 B

date menu next prev title weight
2013-07-09
main
parent
extras
/extras/urls /extras/highlighting Table of Contents 100

Hugo will automatically parse the Markdown for your content and create a Table of Contents you can use to guide readers to the sections within your content.

Usage

Simply create content like you normally would with the appropriate headers.

Hugo will take this Markdown and create a table of contents stored in the content variable .TableOfContents

Template Example

This is example code of a single.html template.

{{ partial "header.html" . }}
    <div id="toc" class="well col-md-4 col-sm-6">
    {{ .TableOfContents }}
    </div>
    <h1>{{ .Title }}</h1>
    {{ .Content }}
{{ partial "footer.html" . }}