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

Params case handling doesn't work in where when given a sequence of pages #7009

Closed
StarfallProjects opened this issue Mar 3, 2020 · 4 comments · Fixed by #8450
Closed

Params case handling doesn't work in where when given a sequence of pages #7009

StarfallProjects opened this issue Mar 3, 2020 · 4 comments · Fixed by #8450
Assignees
Milestone

Comments

@StarfallProjects
Copy link

The problem

Struggling to get where to behave like an example in the docs. I asked for help on the forums (discussion here) and the "solution" was to lowercase a parameter name. This solved the issue, but without lowercasing it in the frontmatter. It also seemed inconsistent, as accessing the camelcased parameter name worked with other functions.

There are code examples in the discussion. I have also added a branch to my repo to preserve the broken vs working examples (as I want to continue working on the project) https://github.com/StarfallProjects/habermas-concepts/tree/brokenWorkingWHERE

If you clone, checkout that branch, run hugo server --buildDrafts, and from the homepage select Concepts > A concept, you should get an example output for this layout: https://github.com/StarfallProjects/habermas-concepts/blob/brokenWorkingWHERE/layouts/concepts/single.html

It has various ways of doing the same thing, broken and working.

What version of Hugo are you using (hugo version)?

$ hugo version
Hugo Static Site Generator v0.65.3-211BA42A windows/amd64 BuildDate: 2020-02-23T09:58:40Z

Does this issue reproduce with the latest release?

Yes

@moorereason moorereason added the Bug label Mar 3, 2020
@moorereason
Copy link
Contributor

This issue was originally meant to be fixed by a3fe5e5, but I don't see where the tests actually cover the {{ range where .Site.Pages "Params.MYPARAM" "foo" }} case. checkWhereArray() handles the case of a slice of Params maps, but not when the sequence is a slice of pages.

@moorereason moorereason changed the title Possible problem in the lookup logic of "where" Params case handling doesn't work in where when given a sequence of pages Mar 3, 2020
@stale
Copy link

stale bot commented Jul 3, 2020

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Jul 3, 2020
@stale stale bot closed this as completed Aug 2, 2020
@moorereason moorereason reopened this Aug 3, 2020
@stale stale bot removed the Stale label Aug 3, 2020
@xoxys
Copy link

xoxys commented Apr 20, 2021

Same here:

---
title: Getting Started
weight: -20
geekdocSearchExclude: true
---

Works: where .Site.Pages "Params.geekdocsearchexclude" "ne" true
Works not: where .Site.Pages "Params.geekdocSearchExclude" "ne" true

@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 Jan 21, 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.

4 participants