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

_index.md / index.md pages won't show TOC or Description #55

Closed
jdcarls2 opened this issue Jun 15, 2023 · 3 comments
Closed

_index.md / index.md pages won't show TOC or Description #55

jdcarls2 opened this issue Jun 15, 2023 · 3 comments

Comments

@jdcarls2
Copy link

jdcarls2 commented Jun 15, 2023

With a page like /projects/some-project.md, setting toc: true adds a great Table of Contents in the sidebar. I love this.

But when I have a page like /projects/some-project/_index.md, the TOC does not render, even when set to true.

Edit to add: Page descriptions do not render in index pages either.

Why would this be?

@jdcarls2 jdcarls2 changed the title _index.md / index.md pages won't show TOC _index.md / index.md pages won't show TOC or Description Jun 16, 2023
@joeroe
Copy link
Owner

joeroe commented Aug 29, 2023

The table of contents and the description, author information etc. in the sidebar is part of risotto's single page template. But _index.md uses the list template, not a single page template.

I'm not sure that, in general, it makes sense to add the TOC/author metadata to list pages. Usually they are in themselves a kind of table of contents, and don't have one specific author. @jdcarls2 What's your intention in using /projects/some-project/_index.md instead of /projects/some-project.md? They should result in the same rendered URL.

However I can see that it would be nice to set a description for these pages.

joeroe added a commit that referenced this issue Aug 29, 2023
@Vinfall
Copy link
Contributor

Vinfall commented Sep 1, 2023

Although a bit off-topic, I think you should also add page description to single page template instead of a site level description?

{{ with .Site.Params.about }}<meta name="description" content="{{ .description }}">{{ end }}

Maybe something like this, I'm not sure whether the page description would just override the site one.

<!-- Site level -->
{{ with .Site.Params.about }}<meta name="description" content="{{ .description }}">{{ end }}
<!-- Page level -->
<meta name="description" content="{{ .Params.description }}">

@jdcarls2
Copy link
Author

jdcarls2 commented Sep 1, 2023

@joeroe Honestly, it was my first time using any kind of static site generator, let alone a Hugo theme. The TOC / Author stuff was just me not totally understanding the intended organization of the site, and it makes total sense to me that an _index.md page would act as the TOC for its directory. But the description is a good add.

@joeroe joeroe closed this as not planned Won't fix, can't repro, duplicate, stale Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants