This commit is contained in:
Bjørn Erik Pedersen 2019-02-01 09:01:04 +01:00
commit ddc15ed41b
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
79 changed files with 6251 additions and 391 deletions

View file

@ -43,10 +43,11 @@ You may want to append a class to a heading according to the length of the strin
## `len` Example 2: Counting Pages with `where`
The following templating uses [`where`][] in conjunction with `len` to figure out the total number of content pages in a `posts` [section][]:
The following templating uses [`where`][] in conjunction with `len` to
figure out the total number of content pages in a `posts` [section][]:
{{< code file="how-many-posts.html" >}}
{{ $posts := (where .Site.RegularPages "Section" "==" "post") }}
{{ $posts := (where .Site.RegularPages "Section" "==" "posts") }}
{{ $postCount := len $posts }}
{{< /code >}}