-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Only auto-create sections for home and first level #6171
Comments
Sounds fair.. so if one needs to retain the auto-creation of
|
@bep So from your content tree structure:
below is a good summary?
|
Yes. Which is kind of "manual" and not automatic... But I think less magical and certainly more flexible. Your table is almost spot on.: |
Ref. the discussion above, and esp. @kaushalmodi 's table: Does this change make sense? If you see some unforeseen consequences, please explain below. |
This was fixed in 7ff0a8e |
Changelog for v0.57.0: https://github.com/gohugoio/hugo/releases/tag/v0.57.0 > `home.Pages` now only returns pages in the top level section. Before this release, it included _all regular pages in the site_. This made it easy to list all the pages on home page, but it also meant that you needed to take special care if you wanted to navigate the page tree from top to bottom. If you need _all regular pages_, use `.Site.RegularPages`. Also see gohugoio/hugo#6153. > `.Pages` now include sections. We have added `.RegularPages` as a convenience method if you want the old behaviour. See gohugoio/hugo#6171 for details.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I'm in the process of a simplification of how we create the "page tree" (and especially the section tree) in preparation for #6041 -- but also needed for the things coming ahead.
This is mostly code simplification which also should (probably) make it a little faster. But there is one part of the "section logic" that I will remove. Both because it is complicated and hard to maintain, but also because I suspect many people don't like the current behaviour, and it's kind of impossible to opt-out off.
Currently, with this tree:
a/b/c/d
because it has a "_index.*" content file.a
,a/b
,a/b/c
andb
.With the new simplified behaviour, Hugo will only "auto create" sections for the home page and the top level folders.
So in the example above, home page and
a
andb
will be "auto created",a/b/c/d
will be a section because of its_index.md
file.Also related:
#6153
#6154
The text was updated successfully, but these errors were encountered: