# ToC not rendering?

**URL:** <https://discourse.gohugo.io/t/toc-not-rendering/47698>\
**Category:** support\
**Created:** [January 3, 2024, 8:21pm UTC](https://discourse.gohugo.io/t/toc-not-rendering/47698 "2024-01-03T20:21:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![koloa\_street](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/koloa_street/32/21003_2.png) [@koloa\_street](https://discourse.gohugo.io/u/koloa_street)\
**Post date:** [January 3, 2024, 8:21pm UTC](https://discourse.gohugo.io/t/toc-not-rendering/47698/1 "2024-01-03T20:21:26Z")

</div>

Hello,  
I am using papermod theme and created the following post below. I have set UseHugoToc: true and ShowToc: true. However, no ToC is rendered. Any help appricated! Thank you.

```plaintext
---
title: "Making general recipe"
date: 2024-01-03
draft: false
UseHugoToc: true
ShowToc: true
tocopen: true
summary: "A brief tutorial on creating recipe"
categories: ["recipe"]
---

This article will provide a brief overview of recipe.

## Acquiring goods

In this step 1.

## Layering piles

In this step 2.

This article will provide a brief overview of pile.

# Acquiring goods

In this step 1.

## Layering piles

In this step 2.

```

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [January 3, 2024, 8:33pm UTC](https://discourse.gohugo.io/t/toc-not-rendering/47698/2 "2024-01-03T20:33:35Z")

</div>

I am unable to reproduce the problem.

```plaintext
hugo new site mysite
cd mysite
git init
git submodule add https://github.com/adityatelange/hugo-PaperMod themes/papermod
echo "theme = 'papermod'" >> hugo.toml
hugo new recipes/tutorial.md

```

Then I pasted your markdown and ran `hugo server`…

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/f/0/f08def3563f507f85ca20a5e642dc86c19fbf75c.png)

---

<div class="post-metadata">

**Author:** ![koloa\_street](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/koloa_street/32/21003_2.png) [@koloa\_street](https://discourse.gohugo.io/u/koloa_street)\
**Post date:** [January 3, 2024, 9:21pm UTC](https://discourse.gohugo.io/t/toc-not-rendering/47698/3 "2024-01-03T21:21:10Z")

</div>

Thank you for verifying. Not sure what else I can do?

If it helps, I am using papermod v7.0, hugo v0.111.3, PC.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [January 3, 2024, 9:29pm UTC](https://discourse.gohugo.io/t/toc-not-rendering/47698/4 "2024-01-03T21:29:08Z")

</div>

You are more likely to receive a prompt and accurate response if you post a link to the public repository for your project.

See [Requesting Help](https://discourse.gohugo.io/t/requesting-help/9132).

> Let us see your code
> 
> Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
> 
> If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.

---

<div class="post-metadata">

**Author:** ![koloa\_street](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/koloa_street/32/21003_2.png) [@koloa\_street](https://discourse.gohugo.io/u/koloa_street)\
**Post date:** [January 3, 2024, 9:30pm UTC](https://discourse.gohugo.io/t/toc-not-rendering/47698/5 "2024-01-03T21:30:14Z")

</div>

Hello, I followed this blog for manually adding a TOC. It appears now it works.

([Hugo: Add Table of Contents Anywhere in Markdown File](https://ruddra.com/hugo-add-toc-anywhere/))

---

<div class="post-metadata">

**Author:** ![koloa\_street](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/koloa_street/32/21003_2.png) [@koloa\_street](https://discourse.gohugo.io/u/koloa_street)\
**Post date:** [January 4, 2024, 1:08am UTC](https://discourse.gohugo.io/t/toc-not-rendering/47698/6 "2024-01-04T01:08:25Z")

</div>

Hi,  
I figured out the problem. My post was in content/articles/new\_post/\_index.md.

I just tried creating a new post in content/new\_post.md and it works.

Can I someone configure hugo to use papermods ToC function in subfolders under content?

---

<div class="post-metadata">

**Author:** ![Arif](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/arif/32/20931_2.png) [@Arif](https://discourse.gohugo.io/u/Arif)\
**Post date:** [January 4, 2024, 6:49am UTC](https://discourse.gohugo.io/t/toc-not-rendering/47698/7 "2024-01-04T06:49:10Z")

</div>

> [@koloa\_street](#):
>
> Can I someone configure hugo to use papermods ToC function in subfolders under content?

See Joe’s [comment](https://discourse.gohugo.io/t/toc-not-rendering/47698/4) or ask the [theme author](https://github.com/adityatelange/hugo-PaperMod/discussions) because what you did by moving the content aound is just a patch, not a solution.

---

<div class="post-metadata">

**Author:** ![koloa\_street](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/koloa_street/32/21003_2.png) [@koloa\_street](https://discourse.gohugo.io/u/koloa_street)\
**Post date:** [January 4, 2024, 4:15pm UTC](https://discourse.gohugo.io/t/toc-not-rendering/47698/8 "2024-01-04T16:15:21Z")

</div>

Also, I just learned that TOC does not work when file is named /content/articles/mynewpost/\_index.md. \_index.md should be any other name than \_index.md.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [January 4, 2024, 5:29pm UTC](https://discourse.gohugo.io/t/toc-not-rendering/47698/9 "2024-01-04T17:29:58Z")

</div>

> [@koloa\_street](#):
>
> TOC does not work when file is named /content/articles/mynewpost/\_index.md

The PaperMod theme renders a TOC for content with [kind](https://gohugo.io/getting-started/glossary/#page-kind) = `page`:  
[https://github.com/adityatelange/hugo-PaperMod/blob/master/layouts/\_default/single.html#L34](https://github.com/adityatelange/hugo-PaperMod/blob/master/layouts/_default/single.html#L34)

The TOC partial is not called from any other template.

```plaintext
content/
├── posts/
│ ├── post-1/
│ │ └── index.md <-- kind = page (toc enabled)
│ ├── _index.md <-- kind = section
│ └── post-2.md <-- kind = page (toc enabled)
└── _index.md <-- kind = home

```

See this [FAQ](https://gohugo.io/troubleshooting/faq/#what-is-the-difference-between-an-indexmd-file-and-an-_indexmd-file).

Please raise additional questions with the [theme author](https://github.com/adityatelange/hugo-PaperMod/discussions).
