We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Typical construct:
{{ range site.Pages.GroupByParam "foo" }} <h2>{{ .Key }}</h2> {{ range .Pages }} <h3><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h3> {{ end }} {{ end }}
For an existing site where one or more of the pages contains params.foo in front matter, this works great.
params.foo
But if none of the pages contains params.foo in front matter, the GroupByParam method throws this error:
GroupByParam
error calling GroupByParam: there is no such param
I think we should return nil instead. Reasoning:
Pages.SortByParam
Pages.GroupByParamDate
Reference: https://discourse.gohugo.io/t/error-calling-groupbyparam-there-is-no-such-param/50205
The text was updated successfully, but these errors were encountered:
Agree.
Sorry, something went wrong.
resources/page: Let GroupByParam return nil instead of error
1eba58a
Closes gohugoio#12578
cba2de6
Closes #12578
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.
jmooring
Successfully merging a pull request may close this issue.
Typical construct:
For an existing site where one or more of the pages contains
params.foo
in front matter, this works great.But if none of the pages contains
params.foo
in front matter, theGroupByParam
method throws this error:I think we should return nil instead. Reasoning:
Pages.SortByParam
doesn't complain about missing paramPages.GroupByParamDate
doesn't complain about missing paramReference: https://discourse.gohugo.io/t/error-calling-groupbyparam-there-is-no-such-param/50205
The text was updated successfully, but these errors were encountered: