# \#toc

**URL:** https://discourse.gohugo.io/tag/toc/92.md

[Latest](https://discourse.gohugo.io/latest.md) · [Categories](https://discourse.gohugo.io/categories.md) · [Tags](https://discourse.gohugo.io/tags.md)

---

## [Hyperlinks in headers "leak" into header anchors](https://discourse.gohugo.io/t/hyperlinks-in-headers-leak-into-header-anchors/53541)

<div class="topic-metadata">

**Author:** [@expurple](https://discourse.gohugo.io/u/expurple)\
**Replies:** 10\
**Last updated:** [February 27, 2025, 4:49pm UTC](https://discourse.gohugo.io/t/hyperlinks-in-headers-leak-into-header-anchors/53541 "2025-02-27T16:49:31Z")

</div>

I’m not 100% sure that this will be recognized as a bug that needs to be fixed, so posting here before posting to the issue tracker, as the issue template advises. Originally, I reported this to the theme that I’m using: …

---

## [Partial Hugo to generate a Table of Contents with \`\<details\>\` and \`\<summary\>\`](https://discourse.gohugo.io/t/partial-hugo-to-generate-a-table-of-contents-with-details-and-summary/51961)

<div class="topic-metadata">

**Author:** [@lgrdev](https://discourse.gohugo.io/u/lgrdev)\
**Replies:** 1\
**Last updated:** [October 15, 2024, 4:08pm UTC](https://discourse.gohugo.io/t/partial-hugo-to-generate-a-table-of-contents-with-details-and-summary/51961 "2024-10-15T16:08:22Z")

</div>

Hello everyone, I wanted to share a partial I created to dynamically generate a Table of Contents (ToC) in Hugo, using the HTML \<details\> and \<summary\> tags for an expandable/collapsible effect. The code first checks i…

---

## [Excluding Table of Contents from generated RSS feed with .Summary](https://discourse.gohugo.io/t/excluding-table-of-contents-from-generated-rss-feed-with-summary/50671)

<div class="topic-metadata">

**Author:** [@sander1095](https://discourse.gohugo.io/u/sander1095)\
**Replies:** 2\
**Last updated:** [July 13, 2024, 10:54am UTC](https://discourse.gohugo.io/t/excluding-table-of-contents-from-generated-rss-feed-with-summary/50671 "2024-07-13T10:54:47Z")

</div>

Hello. Some of my pages contain a .Page.TableOfContents. This gets included in the generated RSS, which is not desirable. The relevant part of the RSS feed logic looks like this \<description\>{{ .Summary | html }}\</des…

---

## [Empty li item in toc is generated](https://discourse.gohugo.io/t/empty-li-item-in-toc-is-generated/50665)

<div class="topic-metadata">

**Author:** [@Prajkt\_Yeole](https://discourse.gohugo.io/u/Prajkt_Yeole)\
**Replies:** 3\
**Last updated:** [July 12, 2024, 5:05pm UTC](https://discourse.gohugo.io/t/empty-li-item-in-toc-is-generated/50665 "2024-07-12T17:05:38Z")

</div>

An empty li is generated in the TOC. I have set the start level to 2 and end level to 3. Once i put h4 above h3 it generates an empty li tag in toc. hugo.toml \[markup\] \[markup.tableOfContents\] endLevel = 3 st…

---

## [Want to create a static TOC with link to headers on my embedded content page, Ace Documentation](https://discourse.gohugo.io/t/want-to-create-a-static-toc-with-link-to-headers-on-my-embedded-content-page-ace-documentation/45999)

<div class="topic-metadata">

**Author:** [@LemonPeter](https://discourse.gohugo.io/u/LemonPeter)\
**Replies:** 1\
**Last updated:** [September 1, 2023, 1:40pm UTC](https://discourse.gohugo.io/t/want-to-create-a-static-toc-with-link-to-headers-on-my-embedded-content-page-ace-documentation/45999 "2023-09-01T13:40:30Z")

</div>

The automatic TOC using “##” is not available for my case because I’ve embedded a .yaml file using swaggerUI so the TOC is simply not showing(makes sense). So now I’m looking for a way to manually add a TOC on the side …

---

## [Count headings in Table of Contents](https://discourse.gohugo.io/t/count-headings-in-table-of-contents/44416)

<div class="topic-metadata">

**Author:** [@teamcrisis](https://discourse.gohugo.io/u/teamcrisis)\
**Replies:** 3\
**Last updated:** [May 18, 2023, 6:19pm UTC](https://discourse.gohugo.io/t/count-headings-in-table-of-contents/44416 "2023-05-18T18:19:27Z")

</div>

Is it possible to count the number of headings in the Table of Contents and then add a css class to the markup if the count exceeds a value? For long pages with many headings, I’d like to add a css class to the markup o…

---

## [How to get tablecontent of level as variables use in template?](https://discourse.gohugo.io/t/how-to-get-tablecontent-of-level-as-variables-use-in-template/43836)

<div class="topic-metadata">

**Author:** [@elkan1788](https://discourse.gohugo.io/u/elkan1788)\
**Replies:** 1\
**Last updated:** [April 10, 2023, 3:44pm UTC](https://discourse.gohugo.io/t/how-to-get-tablecontent-of-level-as-variables-use-in-template/43836 "2023-04-10T15:44:27Z")

</div>

Hi guys: There I were added a feature in my theme that can automatic append the numberical number before head title in post body. It was work with the CSS counter-rest function as below example: .autonumber { h2 { …

---

## [Customise table of content](https://discourse.gohugo.io/t/customise-table-of-content/43470)

<div class="topic-metadata">

**Author:** [@sauravlal15](https://discourse.gohugo.io/u/sauravlal15)\
**Replies:** 4\
**Last updated:** [March 19, 2023, 4:00pm UTC](https://discourse.gohugo.io/t/customise-table-of-content/43470 "2023-03-19T16:00:33Z")

</div>

Hi everyone, I want to customise my table of contents, I’m using {{ .TableOfContents }} for generating toc. For most of the pages, I want to use the \<h2\> to \<h3\> tag as the heading for toc, But for some pages, I want to…

---

## [Markdown read with the Docsy theme's readfile shortcode is not included in TOC](https://discourse.gohugo.io/t/markdown-read-with-the-docsy-themes-readfile-shortcode-is-not-included-in-toc/42747)

<div class="topic-metadata">

**Author:** [@nadine](https://discourse.gohugo.io/u/nadine)\
**Replies:** 10\
**Last updated:** [February 2, 2023, 11:12pm UTC](https://discourse.gohugo.io/t/markdown-read-with-the-docsy-themes-readfile-shortcode-is-not-included-in-toc/42747 "2023-02-02T23:12:28Z")

</div>

Hey all, I am using the Docsy theme and the readfile shortcode to include markdown files on other pages. I noticed that the right-hand nav is not showing any of the headings that are part of the file that I am including…

---

## [Shortcodes within shortcodes not rendering](https://discourse.gohugo.io/t/shortcodes-within-shortcodes-not-rendering/42343)

<div class="topic-metadata">

**Author:** [@John\_Hayter](https://discourse.gohugo.io/u/John_Hayter)\
**Replies:** 5\
**Last updated:** [January 10, 2023, 6:39pm UTC](https://discourse.gohugo.io/t/shortcodes-within-shortcodes-not-rendering/42343 "2023-01-10T18:39:59Z")

</div>

I’m using a shortcode to call a snippet of markdown text (300-odd lines). As recommended by @jmooring in the post No TableOfContents when reusing content, the shortcode which calls the snippet is {{ $src := "" }} {{- i…

---

## [No table of contents from partial calling separate markdown files](https://discourse.gohugo.io/t/no-table-of-contents-from-partial-calling-separate-markdown-files/38967)

<div class="topic-metadata">

**Author:** [@radish-es](https://discourse.gohugo.io/u/radish-es)\
**Replies:** 2\
**Last updated:** [June 9, 2022, 7:24am UTC](https://discourse.gohugo.io/t/no-table-of-contents-from-partial-calling-separate-markdown-files/38967 "2022-06-09T07:24:55Z")

</div>

I have a site page written in markdown that includes YAML list data as follows: --- title: "Week 1" type: book components: - style: Moore v California file: moore.md \_template: case --- And I have a partial l…
