diff options
author | Bjørn Erik Pedersen <[email protected]> | 2017-06-26 20:46:06 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2017-06-26 20:46:06 +0200 |
commit | a7765bb3c117efa93866556d2b5b129dae7768bf (patch) | |
tree | d0df162c8d2801006863cb89c9640c89213644b2 /docs/content/extras/toc.md | |
parent | 31393f6024416ea1b2e61d1080dfd7104df36eda (diff) | |
parent | dd78d5b23fe597f4461aa4199401b4e07c0612e2 (diff) | |
download | hugo-a7765bb3c117efa93866556d2b5b129dae7768bf.tar.gz hugo-a7765bb3c117efa93866556d2b5b129dae7768bf.zip |
Merge commit 'dd78d5b23fe597f4461aa4199401b4e07c0612e2' as 'docs'
Diffstat (limited to 'docs/content/extras/toc.md')
-rw-r--r-- | docs/content/extras/toc.md | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/docs/content/extras/toc.md b/docs/content/extras/toc.md new file mode 100644 index 000000000..56e093ba7 --- /dev/null +++ b/docs/content/extras/toc.md @@ -0,0 +1,37 @@ +--- +lastmod: 2015-01-27 +date: 2013-07-09 +menu: + main: + parent: extras +next: /extras/localfiles +prev: /extras/highlighting +title: Table of Contents +--- + +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/). + + {{ partial "header.html" . }} + <div id="toc" class="well col-md-4 col-sm-6"> + {{ .TableOfContents }} + </div> + <h1>{{ .Title }}</h1> + {{ .Content }} + {{ partial "footer.html" . }} + + |