ToC not rendering?

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.

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.

I am unable to reproduce the problem.

hugo new site mysite
cd mysite
git init
git submodule add themes/papermod
echo "theme = 'papermod'" >> hugo.toml
hugo new recipes/

Then I pasted your markdown and ran hugo server

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.

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.

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.

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

(Hugo: Add Table of Contents Anywhere in Markdown File)

I figured out the problem. My post was in content/articles/new_post/

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

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

See Joe’s comment or ask the theme author because what you did by moving the content aound is just a patch, not a solution.

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

The PaperMod theme renders a TOC for content with kind = page:

The TOC partial is not called from any other template.

├── posts/
│   ├── post-1/
│   │   └──  <-- kind = page (toc enabled)
│   ├──     <-- kind = section
│   └──     <-- kind = page (toc enabled)
└──         <-- kind = home

See this FAQ.

Please raise additional questions with the theme author.