diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-06-17 12:03:52 +0200 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-06-17 12:03:52 +0200 |
commit | c4e6b7fd8d25e475425d1efefccdd739d5435dc2 (patch) | |
tree | f03d646ef94170a9be89f132075ac109087f1e73 | |
parent | 6814ff2e9bbe8bc51834c948ae14a59a326b3789 (diff) | |
download | hakyll-c4e6b7fd8d25e475425d1efefccdd739d5435dc2.tar.gz |
Update teaser tutorial
-rw-r--r-- | web/tutorials/using-teasers-in-hakyll.markdown | 13 |
1 files changed, 13 insertions, 0 deletions
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 `<!--more-->` 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 `<!--more-->` to separate the teaser, |