docs: Document complement
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 7 Nov 2018 07:52:41 +0000 (08:52 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 7 Nov 2018 09:38:58 +0000 (10:38 +0100)
Closes https://github.com/gohugoio/hugoDocs/issues/658

docs/content/en/functions/complement.md [new file with mode: 0644]
docs/content/en/functions/intersect.md
docs/themes/gohugoioTheme/layouts/index.html

diff --git a/docs/content/en/functions/complement.md b/docs/content/en/functions/complement.md
new file mode 100644 (file)
index 0000000..4612277
--- /dev/null
@@ -0,0 +1,29 @@
+---
+title: "complement"
+description: "`collections.Complement` (alias `complement`) gives the elements of a collection that are not in any of the others."
+date: 2018-11-07
+categories: [functions]
+menu:
+  docs:
+    parent: "functions"
+keywords: [collections,intersect,union]
+signature: ["COLLECTION | complement COLLECTION [COLLECTION]..." ]
+hugoversion: "0.51"
+aliases: []
+---
+
+Example:
+
+```go-html-template
+{{ $pages := .Site.RegularPages | first 50 }}
+{{ $news := where $pages "Type" "news" | first 5 }}
+{{ $blog := where $pages "Type" "blog" | first 5 }}
+{{ $other := $pages | complement $news $blog | first 10 }}
+```
+
+The above is an imaginary use case for the home page where you want to display different page listings in sections/boxes on different places on the page: 5 from `news`, 5 from the `blog` and then 10 of the pages not shown in the other listings, to _complement_ them.
+
+
+
+
+
index 6d2efacbca4b9578f03a830cc2be2f3f4a80dadf..53f26d950452291994085e25714aa131df0cb6c1 100644 (file)
@@ -10,7 +10,7 @@ categories: [functions]
 menu:
   docs:
     parent: "functions"
-keywords: []
+keywords: [collections,intersect,union,complement,symdiff]
 signature: ["intersect SET1 SET2"]
 workson: []
 hugoversion:
index 2f9364c8c294f74d582483430e9f47c9fe248b0a..93dfdd6c60ef6d583c6401a35fa8ae26e6169d38 100644 (file)
@@ -4,7 +4,6 @@
 {{ end }}
 
 {{ define "main" }}
-
   <section class="w-100 ph4 ph5-ns pv4">
     {{- partial "home-page-sections/features-icons" . -}}
   </section>