I can't disable Table of Content from my pages

Hello my friends, I try to disable Table of Content from my pages (example)

Here is my config.toml file:

baseurl = "https://xoriopalio.github.io"
DefaultContentLanguage = "en"
Title = "Το Χωριό Παλιό"
theme = "beautifulhugo"
metaDataFormat = "yaml"
disableToc = true

Thanks in advance
Aris

disableToc is not a valid configuration setting.
metaDataFormat is not a valid configuration setting either; it was removed a long time ago.

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

Thanks for you reply. Here is my public repo: https://github.com/xoriopalio/xoriopalio.github.io

thanks in advance

This isn’t helpful. We need the source, not the public directory.

here it is https://github.com/igoumeninja/xoriopalio_hugo.

thanks in advance

I’ll have a look at the repository later today. In the interim, here’s a dirty fix…

config.toml

[markup.tableOfContents]
startLevel = 0
endLevel = 0

At a minimum this will leave an empty <nav> element, perhaps more depending on the theme.

Thanks for that. dirty fix didn’t work :roll_eyes:

repo link

thanks in advance

Many of the markdown files in your content directory contain:

# Table of Contents

Why? If you don’t want that heading to appear, you need to remove it from the markdown file.

I am writing in Emacs org-mode and I convert them through ox-hugo. So, there can be the problem?

I have no idea, but it is not a problem with Hugo.

This might be helpful:
https://ox-hugo.scripter.co/doc/org-toc/

Adding

:EXPORT_OPTIONS: toc:nil

to org-mode properties

Goodnight from Greece

1 Like

This layout file here:

Adds the TOC if the frontmatter contains a toc variable AND if there are more than 400 words in the post. Leaving toc out of the frontmatter completely should hide the TOC too.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.