summaryrefslogtreecommitdiff
path: root/web/tutorials
diff options
context:
space:
mode:
authorBeerend Lauwers <Beerendlauwers@gmail.com>2017-01-17 07:36:35 +0100
committerGitHub <noreply@github.com>2017-01-17 07:36:35 +0100
commit7558a4c73dc2042a8eebd545805077ecceb7ca69 (patch)
tree0c096935d98d5f29a24ab8321afa562090c270a6 /web/tutorials
parent9770dd98b09155e6e5d043eb886f4dff0c889aa8 (diff)
downloadhakyll-7558a4c73dc2042a8eebd545805077ecceb7ca69.tar.gz
Added information about the separator functionality in $for$.
Diffstat (limited to 'web/tutorials')
-rw-r--r--web/tutorials/04-compilers.markdown14
1 files changed, 14 insertions, 0 deletions
diff --git a/web/tutorials/04-compilers.markdown b/web/tutorials/04-compilers.markdown
index a9423dc..deb07f9 100644
--- a/web/tutorials/04-compilers.markdown
+++ b/web/tutorials/04-compilers.markdown
@@ -236,6 +236,20 @@ This uses the `$for(foo)$` construct. This construct allows you loop over a
list, in this case, `$posts$`. Inside the body of this for loop, all fields
refer to the current post, e.g.: `$url$`, `$title$` and `$date$`.
+You can also add a simple separator with the special `$sep$` field.
+Everything between `$sep$` and `$endfor$` will be regarded as a separator
+that will only be shown if there is more than one item in the list.
+
+```html
+<ul>
+ $for(posts)$
+ $x$
+ $sep$,
+ $endfor$
+</ul>
+```
+
+
Of course, $posts$ does not magically appear. We have to specify this in
`site.hs`. Let's look at how `archive.html` is generated: