Welcome to mirror list, hosted at ThFree Co, Russian Federation.

toc.md « extras « content « docs - github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f91511c2ad769e759d1bf8cd776efd56d064cb37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
title: "Table of Contents"
date: "2013-07-09"
weight: 60
menu:
  main:
    parent: 'extras'
prev: "/extras/highlighting"
next: "/extras/urls"
---

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 "partials/header.html" . }}
        <div id="toc" class="well col-md-4 col-sm-6">
        {{ .TableOfContents }}
        </div>
        <h1>{{ .Title }}</h1>
        {{ .Content }}
    {{ template "partials/footer.html" . }}