2014-02-21 00:04:08 +00:00
|
|
|
---
|
|
|
|
title: "Table of Contents"
|
|
|
|
date: "2013-07-09"
|
2014-04-23 07:00:11 +00:00
|
|
|
weight: 70
|
|
|
|
menu:
|
|
|
|
main:
|
|
|
|
parent: 'extras'
|
2014-02-21 00:04:08 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
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
|
2014-05-15 13:58:55 +00:00
|
|
|
your content.
|
2014-02-21 00:04:08 +00:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
Simply create content like you normally would with the appropriate
|
2014-05-15 13:58:55 +00:00
|
|
|
headers.
|
2014-02-21 00:04:08 +00:00
|
|
|
|
|
|
|
Hugo will take this markdown and create a table of contents stored in the
|
|
|
|
[content variable](/layout/variables) .TableOfContents
|
|
|
|
|
|
|
|
|
|
|
|
## Template Example
|
|
|
|
|
|
|
|
This is example code of a [single.html template](/layout/content).
|
|
|
|
|
|
|
|
{{ template "chrome/header.html" . }}
|
|
|
|
<div id="toc" class="well col-md-4 col-sm-6">
|
|
|
|
{{ .TableOfContents }}
|
|
|
|
</div>
|
|
|
|
<h1>{{ .Title }}</h1>
|
|
|
|
{{ .Content }}
|
|
|
|
{{ template "chrome/footer.html" . }}
|
|
|
|
|
|
|
|
|