mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-23 18:51:02 +00:00
Adding documentation on Table of Contents functionality
This commit is contained in:
parent
30e804eee5
commit
e74d1b8607
1 changed files with 33 additions and 0 deletions
33
docs/content/extras/toc.md
Normal file
33
docs/content/extras/toc.md
Normal file
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
title: "Table of Contents"
|
||||
date: "2013-07-09"
|
||||
groups: ["extras"]
|
||||
groups_weight: 70
|
||||
---
|
||||
|
||||
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](/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" . }}
|
||||
|
||||
|
Loading…
Reference in a new issue