hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit d313bc78a478f9457ce8b496ede0b231e6b4d0f1
parent 29c9a40a8d5defbe69c38e9997313ce27df55eaf
Author: Benny Wu <benzwu@gmail.com>
Date:   Tue, 11 Aug 2015 09:33:13 +0700

Documentation update on Template Where Function for nil

Diffstat:
Mdocs/content/templates/functions.md | 16++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git a/docs/content/templates/functions.md b/docs/content/templates/functions.md
@@ -265,6 +265,22 @@ Following operators are now available
        {{ .Content }}
     {{ end }}
 
+### Unset field
+Filter only work for set fields. To check whether a field is set or exist, use operand `nil`.
+
+This can be useful to filter a small amount of pages from a large pool. Instead of set field on all pages, you can set field on required pages only.
+
+Only following operators are available for `nil`
+
+- `=`, `==`, `eq`: True if the given field is not set.
+- `!=`, `<>`, `ne`: True if the given field is set.
+
+e.g.
+
+    {{ range where .Data.Pages ".Params.specialpost" "!=" nil }}
+       {{ .Content }}
+    {{ end }}
+
 
 ## Math