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
feat: add parents property on page #10567
Conversation
I agree that the idea is good, but I suggest we use Also, could you:
|
hugolib/page__tree.go
Outdated
func (pt pageTree) Ancestors() (parents page.Pages) { | ||
parent := pt.Parent() | ||
for parent != nil { | ||
parents = append(parents, parent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicking, but
parents
should be named something else- we only use named return values when really needed (e.g. when we need to capture a panic and assign to err), so I would prefer
Ancestors() page.Pages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I can do it. I need to merge this soonish, as I'm releasing today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I got COVID-19 and I'm fine now
@jmooring for me this is an obvious improvement, agree? |
Yes. Took it for a spin. 👍 |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Add parents property on page, simplify breadcrumb navigation implementation complexity
community tricks see: https://discourse.gohugo.io/search?q=breadcrumb
in HTML:
in JSON-LD:
see https://developers.google.com/search/docs/appearance/structured-data/breadcrumb