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

Can I avoid adding _index in the docs? #504

Open
mlosun opened this issue Dec 1, 2024 · 3 comments
Open

Can I avoid adding _index in the docs? #504

mlosun opened this issue Dec 1, 2024 · 3 comments
Labels

Comments

@mlosun
Copy link

mlosun commented Dec 1, 2024

Great theme, I started using it as soon as I saw it.

However, I don't really want each directory to have its own page; I only want to use _index to add a directory page when I need it.

Alternatively, this directory page could automatically generate an index instead of me manually adding each document.

Also, in the sidebar, clicking should directly expand the documents (or there could be a setting to make this directory default to being expanded).

Is this achievable?

@imfing
Copy link
Owner

imfing commented Dec 4, 2024

However, I don't really want each directory to have its own page; I only want to use _index to add a directory page when I need it.

you don't necessarily need an _index.md file for each directory. see: https://gohugo.io/content-management/organization/#organization-of-content-source

Alternatively, this directory page could automatically generate an index instead of me manually adding each document.

not sure that this is possible in Hugo, as it only generates an index page when there's _index.md file presents

Also, in the sidebar, clicking should directly expand the documents (or there could be a setting to make this directory default to being expanded).

there are settings to expand an item in the sidebar:

sidebar:
open: true

@mlosun
Copy link
Author

mlosun commented Dec 8, 2024

WX20241208-155405
WX20241208-155415

Thanks, the issue with expanding the sidebar has been resolved.

Regarding the _index.md issue, when there is no _index.md in a directory, the other articles in that directory are displayed flat on the frontend rather than being nested within the directory structure. I would prefer for them to maintain the same directory hierarchy as in the source files, without needing an index page.

(Actually, I don't want to spend time writing or frequently adjusting index pages, which is why I brought up the idea of either removing the index page or automatically generating its content.I think this approach might help me (or others) focus more on the content itself.)

@imfing
Copy link
Owner

imfing commented Dec 8, 2024

Regarding the _index.md issue, when there is no _index.md in a directory, the other articles in that directory are displayed flat on the frontend rather than being nested within the directory structure. I would prefer for them to maintain the same directory hierarchy as in the source files, without needing an index page.

It makes sense. I have a WIP #376 that generates the sidebar from a file, rather than inferring from the folder structure, which is not very flexible.

@imfing imfing added the sidebar label Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants