From 7558a4c73dc2042a8eebd545805077ecceb7ca69 Mon Sep 17 00:00:00 2001 From: Beerend Lauwers Date: Tue, 17 Jan 2017 07:36:35 +0100 Subject: Added information about the separator functionality in $for$. --- web/tutorials/04-compilers.markdown | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'web/tutorials') 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 + +``` + + Of course, $posts$ does not magically appear. We have to specify this in `site.hs`. Let's look at how `archive.html` is generated: -- cgit v1.2.3