Skip to main content
  1. Posts/

Missing Level 1 Header in TOC in Latest Hugo

··110 words·1 min·
Blog Hugo Markdown
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?
··501 words·1 min
Blog Hugo Markdown
Markdown 生成 HTML 时汉字之间出现多余空格问题
··747 words·2 mins
Blog Markdown Pandoc Hugo
把博客从 Hexo 迁移到 Hugo
··3194 words·7 mins
Blog Hugo Hexo MathJax LaTeX Pandoc Markdown