Remove leading dot from where function KEY (#1419)

Closes #1418
This commit is contained in:
Joe Mooring 2021-04-14 22:42:50 -07:00 committed by GitHub
parent 363251a517
commit 9f8ba56dc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -86,7 +86,7 @@ The following logical operators are available with `where`:
## Use `where` with `Booleans` ## Use `where` with `Booleans`
When using booleans you should not put quotation marks. When using booleans you should not put quotation marks.
```go-html-template ```go-html-template
{{range where .Pages ".Draft" true}} {{range where .Pages "Draft" true}}
<p>{{.Title}}</p> <p>{{.Title}}</p>
{{end}} {{end}}
``` ```
@ -95,7 +95,7 @@ When using booleans you should not put quotation marks.
## Use `where` with `intersect` ## Use `where` with `intersect`
```go-html-template ```go-html-template
{{ range where .Site.Pages ".Params.tags" "intersect" .Params.tags }} {{ range where .Site.Pages "Params.tags" "intersect" .Params.tags }}
{{ if ne .Permalink $.Permalink }} {{ if ne .Permalink $.Permalink }}
{{ .Render "summary" }} {{ .Render "summary" }}
{{ end }} {{ end }}
@ -131,7 +131,7 @@ then ranges through only the first 5 posts in that list:
You can also nest `where` clauses to drill down on lists of content by more than one parameter. The following first grabs all pages in the "blog" section and then ranges through the result of the first `where` clause and finds all pages that are *not* featured: You can also nest `where` clauses to drill down on lists of content by more than one parameter. The following first grabs all pages in the "blog" section and then ranges through the result of the first `where` clause and finds all pages that are *not* featured:
```go-html-template ```go-html-template
{{ range where (where .Pages "Section" "blog" ) ".Params.featured" "!=" true }} {{ range where (where .Pages "Section" "blog" ) "Params.featured" "!=" true }}
``` ```
## Unset Fields ## Unset Fields
@ -146,7 +146,7 @@ Only the following operators are available for `nil`
* `!=`, `<>`, `ne`: True if the given field is set. * `!=`, `<>`, `ne`: True if the given field is set.
```go-html-template ```go-html-template
{{ range where .Pages ".Params.specialpost" "!=" nil }} {{ range where .Pages "Params.specialpost" "!=" nil }}
{{ .Content }} {{ .Content }}
{{ end }} {{ end }}
``` ```

View File

@ -99,7 +99,7 @@ Value: {{ partial "my-inline-partial" . }}
### Example GetFeatured ### Example GetFeatured
```go-html-template ```go-html-template
{{/* layouts/partials/GetFeatured.html */}} {{/* layouts/partials/GetFeatured.html */}}
{{ return first . (where site.RegularPages ".Params.featured" true) }} {{ return first . (where site.RegularPages "Params.featured" true) }}
``` ```
```go-html-template ```go-html-template