-
The menu should not show hidden contents. However, if you access a hidden page via a link or directly, the corresponding menu entry appears. This is unexpected and (iirc) did not occur in the Hugo Learn theme. Is this a bug or can it be configured so that hidden content never appears in the menu? Here is an example: Opening https://mcshelby.github.io/hugo-theme-relearn/, "This could be yours" is hidden (as expected). If you then access https://mcshelby.github.io/hugo-theme-relearn/yours/, an entry appears in the menu (second screenshot). |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
This is a feature and can not be configured. This behaviour differs from the Learn theme. The rational behind is this: Hidden means, the page is included in your site. If you don't want to include the page at all, you can set the page's frontmatter to Once a page is included in your site, it can always be accessed directly by typing the corresponding URL in the browser address bar regardless of its hidden state. So far so good. Now the point is: If you are viewing a hidden page, you want to know where it is located in your site structure and therefore displays in the menu. Otherwise you wouldn't have a clue where it resides in your structure. Keep in mind, that there are further config parameters to handle different aspects of hidden pages, like # Disable search in hidden pages, otherwise they will be shown in search box
disableSearchHiddenPages = false
# Disables hidden pages from showing up in the sitemap and on Google (et all), otherwise they may be indexed by search engines
disableSeoHiddenPages = false
# Disables hidden pages from showing up on the tags page although the tag term will be displayed even if all pages are hidden
disableTagHiddenPages = false |
Beta Was this translation helpful? Give feedback.
-
ah, i see. my aim was to address the hidden pages via the "More" section in the menu and to keep them completely out of the normal menu. example: in the normal menu i arrange the topics of my lecture (script, each lecture is a separate page). in the "More" part i arrange topics like syllabus, grading, ... these things should not appear as structure in the normal menu (even if you access them -- they are in "More"), so i set them to "hidden". i'll leave the issue open for now, in case you change your mind and want to make it configurable. feel free to close if you want to stay with the current interpretation. |
Beta Was this translation helpful? Give feedback.
-
The hidden pages feature isn't made for your use case as your pages are obviously not meant to be hidden but only to be displayed in a different structure. That it worked for you in the Learn theme was - IMHO - a bug, and so I fixed it. But: I may have a working solution for you:
title = "Blub"
[_build]
render = "always"
list = "never"
publishResources = true |
Beta Was this translation helpful? Give feedback.
-
I also wasn't aware of this Hugo feature by now and it also resolves an issue with the piratified showcase of the exampleSite not displaying any images. The fix is pushed so you can look this up for an example. |
Beta Was this translation helpful? Give feedback.
The hidden pages feature isn't made for your use case as your pages are obviously not meant to be hidden but only to be displayed in a different structure. That it worked for you in the Learn theme was - IMHO - a bug, and so I fixed it.
But: I may have a working solution for you:
credits.html
of theexampleSite
).more/showcase/_index.en.md
of theexampleSite
):