mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
698 B
698 B
title | description | categories | menu | keywords | signature | relatedfuncs | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
len | Returns the length of a string, slice, map, or collection. |
|
|
|
|
With a string:
{{ "ab" | len }} → 2
{{ "" | len }} → 0
With a slice:
{{ slice "a" "b" | len }} → 2
{{ slice | len }} → 0
With a map:
{{ dict "a" 1 "b" 2 | len }} → 2
{{ dict | len }} → 0
With a collection:
{{ site.RegularPages | len }} → 42
You may also determine the number of pages in a collection with:
{{ site.RegularPages.Len }} → 42