You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
967 B

4 years ago
  1. +++
  2. title = "Table of Contents"
  3. description = "Quickly locate information in longer posts."
  4. categories = ["navigation"]
  5. tags = ["metadata"]
  6. features = ["related content", "snippets", "code highlighter"]
  7. [[copyright]]
  8. owner = "Josh Habdas"
  9. date = "2019"
  10. license = "agpl-3.0-or-later"
  11. +++
  12. Automatically generate a table of contents with smooth-scroll links based on the current {{< external href="https://gsnedders.html5.org/outliner/" text="page outline" />}}. To do so add the following to post {{< external href="https://gohugo.io/content-management/front-matter/" text="Front Matter" />}}:
  13. ```toml
  14. toc = true
  15. ```
  16. Set `false`, or simply remove the setting, to disable.
  17. The table of contents will be collapsed under a disclosure on page load. Once the disclosure is expanded the full page outline will be revealed. Selecting an item in the outline will smooth-scroll to the corresponding section, update the browser history and highlight the section title.