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

Make .Pages include the sub sections #6154

Closed
bep opened this issue Aug 2, 2019 · 1 comment · Fixed by #6181
Closed

Make .Pages include the sub sections #6154

bep opened this issue Aug 2, 2019 · 1 comment · Fixed by #6181
Assignees
Milestone

Comments

@bep
Copy link
Member

bep commented Aug 2, 2019

This relates to #6153

We currently have:

  • .Pages
  • .Sections
  • And the first does not include the latter.

I suspect the above behaviour came from the fear of breaking stuff. And while .Sections is convenient for breadcrumb navigation etc., I would guess that in 90% of the situations where you do .Pages you also want to include the sections, so you end up with:

{{ $pages := (.Pages | union .Sections ).Sort }}

The above works, but is hardly optimal. I think it's better to let the 10% use cases do the filtering.

We can consider adding a .RegularPages convenience method, which should get everything in line with how .Site.Pages etc. works.

@bep bep self-assigned this Aug 2, 2019
@bep bep added the Enhancement label Aug 2, 2019
@bep bep added this to the v0.57 milestone Aug 2, 2019
bep added a commit to bep/hugo that referenced this issue Aug 2, 2019
bep added a commit to bep/hugo that referenced this issue Aug 2, 2019
bep added a commit to bep/hugo that referenced this issue Aug 2, 2019
bep added a commit to bep/hugo that referenced this issue Aug 2, 2019
bep added a commit to bep/hugo that referenced this issue Aug 6, 2019
This is preparation for gohugoio#6041.

For historic reasons, the code for bulding the section tree and the taxonomies were very much separate.

This works, but makes it hard to extend, maintain, and possibly not so fast as it could be.

This simplification also introduces 3 slightly breaking changes, which I suspect most people will be pleased about. See referenced issues:

Fixes gohugoio#6154
Fixes gohugoio#6153
Fixes gohugoio#6152
bep added a commit to bep/hugo that referenced this issue Aug 8, 2019
This is preparation for gohugoio#6041.

For historic reasons, the code for bulding the section tree and the taxonomies were very much separate.

This works, but makes it hard to extend, maintain, and possibly not so fast as it could be.

This simplification also introduces 3 slightly breaking changes, which I suspect most people will be pleased about. See referenced issues:

Fixes gohugoio#6154
Fixes gohugoio#6153
Fixes gohugoio#6152
bep added a commit to bep/hugo that referenced this issue Aug 8, 2019
This is preparation for gohugoio#6041.

For historic reasons, the code for bulding the section tree and the taxonomies were very much separate.

This works, but makes it hard to extend, maintain, and possibly not so fast as it could be.

This simplification also introduces 3 slightly breaking changes, which I suspect most people will be pleased about. See referenced issues:

Fixes gohugoio#6154
Fixes gohugoio#6153
Fixes gohugoio#6152
bep added a commit to bep/hugo that referenced this issue Aug 8, 2019
This is preparation for gohugoio#6041.

For historic reasons, the code for bulding the section tree and the taxonomies were very much separate.

This works, but makes it hard to extend, maintain, and possibly not so fast as it could be.

This simplification also introduces 3 slightly breaking changes, which I suspect most people will be pleased about. See referenced issues:

Fixes gohugoio#6154
Fixes gohugoio#6153
Fixes gohugoio#6152
bep added a commit to bep/hugo that referenced this issue Aug 8, 2019
This is preparation for gohugoio#6041.

For historic reasons, the code for bulding the section tree and the taxonomies were very much separate.

This works, but makes it hard to extend, maintain, and possibly not so fast as it could be.

This simplification also introduces 3 slightly breaking changes, which I suspect most people will be pleased about. See referenced issues:

This commit also switches the radix tree dependency to a mutable implementation: github.com/armon/go-radix.

Fixes gohugoio#6154
Fixes gohugoio#6153
Fixes gohugoio#6152
bep added a commit to bep/hugo that referenced this issue Aug 8, 2019
This is preparation for gohugoio#6041.

For historic reasons, the code for bulding the section tree and the taxonomies were very much separate.

This works, but makes it hard to extend, maintain, and possibly not so fast as it could be.

This simplification also introduces 3 slightly breaking changes, which I suspect most people will be pleased about. See referenced issues:

This commit also switches the radix tree dependency to a mutable implementation: github.com/armon/go-radix.

Fixes gohugoio#6154
Fixes gohugoio#6153
Fixes gohugoio#6152
@bep bep closed this as completed in #6181 Aug 8, 2019
bep added a commit that referenced this issue Aug 8, 2019
This is preparation for #6041.

For historic reasons, the code for bulding the section tree and the taxonomies were very much separate.

This works, but makes it hard to extend, maintain, and possibly not so fast as it could be.

This simplification also introduces 3 slightly breaking changes, which I suspect most people will be pleased about. See referenced issues:

This commit also switches the radix tree dependency to a mutable implementation: github.com/armon/go-radix.

Fixes #6154
Fixes #6153
Fixes #6152
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant