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

Documentation update for nil in template function where #1341

Closed
benzwu opened this issue Aug 9, 2015 · 4 comments
Closed

Documentation update for nil in template function where #1341

benzwu opened this issue Aug 9, 2015 · 4 comments

Comments

@benzwu
Copy link
Contributor

benzwu commented Aug 9, 2015

This fix is not reflected back to documentation

where template function's internal condition check function always
returns false when a target value doesn't exist or it's nil value but
this behavior makes it difficult to filter values which doesn't have a
particular parameter.

To solve it, this adds nil value comparison to the function.
where Values ".Param.key" nil like clause can be used for the case
above.

Only "=", "==", "eq", "!=", "<>", "ne" operators are allowed to be used
with nil. If an other operator is passed with nil, the condition
check function returns false like before.

Fix #1232

I can update and submit PR for this. Is there any documentation writing guideline?

From http://discuss.gohugo.io/t/template-function-where-with-boolean-and-operator-with-not-set-params/1539/2

@bep bep added the Docs label Aug 9, 2015
@bep
Copy link
Member

bep commented Aug 9, 2015

No writing guideline (we need one ...), just try to follow whats already there. This is would be so useful/important that it needs its own headline, I think.

@benzwu
Copy link
Contributor Author

benzwu commented Aug 10, 2015

the patch is not applied in current 0.14 release. So should wait for release 0.15?

@benzwu
Copy link
Contributor Author

benzwu commented Aug 13, 2015

#1349

@benzwu benzwu closed this as completed Aug 13, 2015
@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 Apr 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants