Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creation of nested TOC entries when using Hugo. #358

Open
GrahamDumpleton opened this issue May 6, 2024 · 2 comments
Open

Allow creation of nested TOC entries when using Hugo. #358

GrahamDumpleton opened this issue May 6, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@GrahamDumpleton
Copy link
Contributor

Is your feature request related to a problem? Please describe.

All pages when using Hugo, whether or not they are nested within sections are rendered in a TOC with a flat namespace. I want to be able to override the structure of the TOC so that one can have pages listed under an entry for the section they are included in.

In other words, things might be displayed at the moment as:

* 1: page 1
* 2: section-1/page 1
* 3: section-1/page 2
* 4: page 2

This includes a page number intended only to illustrate that things are visited in that sequence.

What want to instead have is something like:

* page 1
* section-1
    + page 1
    + page 2
* page 2

Note that not showing numbers as before since not sure how they should be handled.

Describe the solution you'd like

As want to try and avoid mucking up TOC for existing workshops, propose that in order to trigger this behaviour when using Hugo renderer, that the section (branch bundle), needs to have a _index.md file which contains a title in the meta data.

---
title: Section Name
---

Note that to be practical might only support one level of nesting.

Describe alternatives you've considered

No response

Additional information

No response

@GrahamDumpleton GrahamDumpleton added the enhancement New feature or request label May 6, 2024
@GrahamDumpleton
Copy link
Contributor Author

From: https://kubernetes.slack.com/archives/C05UWT4SKRV/p1712670455033879

Suggestion is to use X.Y for page number prefix.

  1. Introductions
    1.1 Introduction to Git
    1.2 Introduction to Kubernetes
    1.3 Introduction to ArgoCD
  2. This is more tidy
  3. I like it a lot

@GrahamDumpleton
Copy link
Contributor Author

One tricky part of supporting this is what to do if someone manually lists the pages in the workshop/config.yaml in a pathway and all pages under one section are not grouped together. One could simply ignore the fact and thus could end up with.

  1. Introductions
    1.1 Introduction to Git
    1.2 Introduction to Kubernetes
  2. This is more tidy
  3. Introductions
    3.1 Introduction to ArgoCD
  4. I like it a lot

Possibly just warn against it and if someone ignores that and results in repeating section name it is their issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

No branches or pull requests

1 participant