Hello! First of all, thank you for developing this theme; it is beautiful.
I have a feature suggestion for Table of Contents for its default state.
Can we have another configuration, such as enableToc, to set the default state? May be tocDefaultState. When that is false, single page is ToC is enabled but turned off by default.
Let me know if you need any help; I'm new to Go, though.
Thanks again.
Did you mean that you want to enable the Toc conditionally?
Did you mean that you want to enable the Toc conditionally?
Yes. As in to set a default state, whether it is open or not. Currently, when it is enabled, it is open by default.
I think it could be done by setting the front matter.
First, update the Zzo theme. I fixed a bug.
Next, set the enableToc Param at the front matter something like this
content/posts/mypost.md
---
title: "my post"
date: 2019-12-26T12:00:24+09:00
description: post desc
tags:
-
series:
-
categories:
-
enableToc: false
---
In this way, you can disable / enable the single page Toc
Ah yes, I found that, thanks. What I'm talking about is another matter I'm afraid because it disables the Toc. Let me show you.
When we enable Toc and open a page, it looks like this right?

What I'm talking about is opening the page like this, so that a user can toggle the Toc.

Ok, It makes sense.
I'll add a param named hideToc on params.toml file.
Hi,Can you use common parameters here? such as toc:false
@fandean Did you mean change the enableToc to toc?
yes
Actually, I do want to change some param names to another,
Why I can't do this is because if I change the params name, other people who use the Zzo theme may conflict with their Hugo site until they change the params as we changed.
The way I think about it is that some of the jekyll site themes I've used before support toc to control the display of the TOC, so I think toc is more general, and this is the first time this parameter has been discussed in a zzo theme
I think that change the existing param name is not a good idea. Someone will get in trouble by the param. In case that if the toc is more general naming, then we can keep enableToc and toc both of them that behave the same role.
OK
@dishanrajapaksha I added param named hideToc. Maybe you want to set this param like this
params.toml file
...
hideToc = true
...
@fandean Bro, I added the toc. You can replace enableToc to toc in params.toml file. Something like this. Now, enableToc and toc params are logically the same.
params.toml file
enableToc = true
toc = true
You can also use toc at front matter in your content md file.
---
...
tags:
- javascript
- programming
series:
-
categories:
-
toc: true
---
@zzossig Thank you, that was fast 馃槃 I just checked, and it works just as I expected. Maybe we can close this issue?
Most helpful comment
@dishanrajapaksha I added param named hideToc. Maybe you want to set this param like this
params.toml file
@fandean Bro, I added the toc. You can replace enableToc to toc in params.toml file. Something like this. Now, enableToc and toc params are logically the same.
params.toml file
enableToc = truetoc = true
You can also use toc at front matter in your content md file.