Skip to main content
  1. Posts/

Missing Level 1 Header in TOC in Latest Hugo

··110 words·1 min·
Table of Contents

After updating Hugo to the latest version (v0.62), apart from the issue of missing HTML code, I have also observed that level 1 header written in Markdown is not rendered in the generated TOC.

After searching for a little bit, it turns out it has also something to do with Hugo’s new goldmark Markdown renderer. According to Hugo’s documentation, it now renders Markdown headings starting from level 2 and ending in level 3. That is why level 1 headings are now not rendered.

To fix this issue, you need to add the following settings to your config.toml:

[markup]
  [markup.tableOfContents]
    endLevel = 4
    startLevel = 1

References
#

Related

Content inside HTML tags missing in Latest Hugo?
··236 words·2 mins
Markdown 生成 HTML 时汉字之间出现多余空格问题
··103 words·1 min
把博客从 Hexo 迁移到 Hugo
··699 words·4 mins