-
-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
26 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,41 @@ | ||
--- | ||
title: How to enable table of content | ||
title: Table of content | ||
date: 2023-05-02 | ||
description: Setup table of content in Hugo blog awesome theme | ||
--- | ||
|
||
## Table of content | ||
|
||
This theme supports displaying table of content in blog posts. | ||
This theme supports displaying table of content (ToC) in blog posts. | ||
|
||
To enable it, globally set `toc` to `true` in `config.toml`: | ||
## Enable table of content on all posts | ||
|
||
To enable ToC on all posts (globally) set parameter `toc` to `true` in `config.toml`. | ||
|
||
```toml | ||
[params] | ||
toc = true | ||
``` | ||
|
||
This will enable table of content for all posts. If you want to enable it for a specific post, add `toc = true` to the front matter of the post: | ||
To disable ToC globally, simply ignore the `toc` parameter or set it to `false`. | ||
|
||
## Disable table of content on certain posts | ||
|
||
```yaml | ||
--- | ||
title: How to enable table of content | ||
date: 2023-05-02 | ||
toc: true | ||
--- | ||
``` | ||
To disable ToC on certain posts, you have to follow two steps. | ||
|
||
1. Set parameter `toc` to `true` in `config.toml`. | ||
|
||
```toml | ||
[params] | ||
toc = true | ||
``` | ||
|
||
2. Add `toc = false` to the front matter of the post for which you wish to disable ToC. | ||
|
||
```yaml | ||
--- | ||
title: How to enable table of content | ||
date: 2023-05-02 | ||
toc: false | ||
--- | ||
``` |