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

Feature Request: Folder name with no _index should not direct to empty page. Show subpages instead #293

Closed
vdawg-git opened this issue Feb 15, 2024 · 11 comments · Fixed by #325
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@vdawg-git
Copy link

Feature Description

Currently when a folder has no _index.md and you click on its name in the sidebar, you get redirected to a blank article page.

Problem/Solution

Either only toggle the collapse, or direct to the first item of the list, or automatically list the subpages. I like the latter the most.

Alternatives Considered

Adding an _index.md to all folders. However, they need to be maintained and kept up to date when their purpose is to link to the subpages.

@vdawg-git
Copy link
Author

vdawg-git commented Feb 15, 2024

Now that I think about it: It might be better UX if the folder name only toggles the list and is not a link to a site itself, as this can be unexpected and makes it harder to find the data you are looking for (or clicking on it just list the subpages)

Edit: I had an even better idea:
By default, if no _index.md is set, it simply shows the links to the subpages.

But, one also add an _index.md with a token like {{ subpages > }}, to allow for adding more information about the category itself :)

@imfing
Copy link
Owner

imfing commented Feb 17, 2024

Currently when a folder has no _index.md and you click on its name in the sidebar, you get redirected to a blank article page.

Hi, can you provide more details on how to reproduce this?

@vdawg-git
Copy link
Author

This is weird. I cloned the Hextra template, removed the _index.md from folder and it works as expected.

Whereas with the files from https://github.com/visual-dawg/hyprland-wiki it creates odd behaviour. Not sure why though.
I will clone its contents into the starter repo and see if maybe my setup was simply wrong

@vdawg-git
Copy link
Author

vdawg-git commented Feb 18, 2024

I created a reproducible repo using the start template here: https://github.com/Visual-Dawg/hextra-bug-report/tree/main

Edit: Here are the files using the Geekdocs theem: https://wiki.hyprland.org/

@imfing
Copy link
Owner

imfing commented Feb 18, 2024

thanks, will look into it 👍

@vdawg-git
Copy link
Author

Thank you! Also a huge thanks for creating this theme. It is by far the best looking theme for Hugo out there

@imfing imfing added the enhancement New feature or request label Feb 19, 2024
@imfing imfing self-assigned this Feb 20, 2024
@imfing imfing added this to the v0.8.0 milestone Feb 20, 2024
@AndyRaphael
Copy link

Hello
I am also interested in this. I tried to create a custom view by adding a list.html to the layouts/blog folder and copied the content from the hextra\layouts\blog\list.html file. However, this causes the page to render incorrectly. all the content is displayed one another. Instead of "sidebar | content | toc", it shows
"Sidebar
toc
content"

@imfing
Copy link
Owner

imfing commented Feb 21, 2024

@AndyRaphael

I tried to create a custom view by adding a list.html to the layouts/blog folder and copied the content from the hextra\layouts\blog\list.html file. However, this causes the page to render incorrectly. all the content is displayed one another. Instead of "sidebar | content | toc", it shows
"Sidebar
toc
content"

regarding this, can you open a separate discussion?

@AndyRaphael
Copy link

Thank you for your great looking template. Looking forward to this update to show folder content automatically.

@imfing
Copy link
Owner

imfing commented Mar 19, 2024

@Visual-Dawg

I created a reproducible repo using the start template here: https://github.com/Visual-Dawg/hextra-bug-report/tree/main

This should be fixed by #325

but I guess you've added _index.md to every sub-directories already :)

@vdawg-git
Copy link
Author

Nice, thank you! Yes, we did, but good to know for the future :D

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
None yet
Development

Successfully merging a pull request may close this issue.

3 participants