From c4e6b7fd8d25e475425d1efefccdd739d5435dc2 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Mon, 17 Jun 2013 12:03:52 +0200 Subject: Update teaser tutorial --- web/tutorials/using-teasers-in-hakyll.markdown | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'web/tutorials') diff --git a/web/tutorials/using-teasers-in-hakyll.markdown b/web/tutorials/using-teasers-in-hakyll.markdown index ebff3e7..978d37b 100644 --- a/web/tutorials/using-teasers-in-hakyll.markdown +++ b/web/tutorials/using-teasers-in-hakyll.markdown @@ -83,6 +83,19 @@ Here, we've just added a new context which knows how to handle `$teaser$` key to the default context (note that we passed the same snapshot name `"content"` which we used while saving). +## Optional teasers + +In case you don't add a `` comment, `$teaser$` will not be defined. +This means you can use something like: + +```html +$if(teaser)$ + $teaser$ +$else$ + $body$ +$endif$ +``` + ## Known issues Since we use an HTML comment `` to separate the teaser, -- cgit v1.2.3