Giter VIP home page Giter VIP logo

Comments (14)

zzossig avatar zzossig commented on July 18, 2024 2

@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
---

from hugo-theme-zzo.

zzossig avatar zzossig commented on July 18, 2024 1

Ok, It makes sense.
I'll add a param named hideToc on params.toml file.

from hugo-theme-zzo.

zzossig avatar zzossig commented on July 18, 2024

Did you mean that you want to enable the Toc conditionally?

from hugo-theme-zzo.

DishanRajapaksha avatar DishanRajapaksha commented on July 18, 2024

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.

from hugo-theme-zzo.

zzossig avatar zzossig commented on July 18, 2024

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

from hugo-theme-zzo.

DishanRajapaksha avatar DishanRajapaksha commented on July 18, 2024

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?

tocOn

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

tocOff

from hugo-theme-zzo.

fandean avatar fandean commented on July 18, 2024

Hi,Can you use common parameters here? such as toc:false

from hugo-theme-zzo.

zzossig avatar zzossig commented on July 18, 2024

@fandean Did you mean change the enableToc to toc?

from hugo-theme-zzo.

fandean avatar fandean commented on July 18, 2024

yes

from hugo-theme-zzo.

zzossig avatar zzossig commented on July 18, 2024

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.

from hugo-theme-zzo.

fandean avatar fandean commented on July 18, 2024

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

from hugo-theme-zzo.

zzossig avatar zzossig commented on July 18, 2024

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.

from hugo-theme-zzo.

fandean avatar fandean commented on July 18, 2024

OK

from hugo-theme-zzo.

DishanRajapaksha avatar DishanRajapaksha commented on July 18, 2024

@zzossig Thank you, that was fast 😄 I just checked, and it works just as I expected. Maybe we can close this issue?

from hugo-theme-zzo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.