summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2013-05-04 09:21:50 -0700
committerJasper Van der Jeugt <jaspervdj@gmail.com>2013-05-04 09:21:50 -0700
commite038725009b8f9a3a3da72bb781be0343c64adb3 (patch)
treef480c035b0fa4e28e4fb89269bb0dc74810853c4 /src
parente5709c0c736ced70d500ff8306c0e1fea9eeef59 (diff)
parent98127118fb6f9f2a08e9063cf9e635205aff3475 (diff)
downloadhakyll-e038725009b8f9a3a3da72bb781be0343c64adb3.tar.gz
Merge pull request #144 from sphynx/master
Written a tutorial about teasers
Diffstat (limited to 'src')
-rw-r--r--src/Hakyll/Web/Template/Context.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Hakyll/Web/Template/Context.hs b/src/Hakyll/Web/Template/Context.hs
index 7751423..74c2e8d 100644
--- a/src/Hakyll/Web/Template/Context.hs
+++ b/src/Hakyll/Web/Template/Context.hs
@@ -92,6 +92,9 @@ defaultContext =
missingField
--------------------------------------------------------------------------------
+-- | A context with "teaser" key which contain a teaser of the item.
+-- The item is loaded from the given snapshot (which should be saved
+-- in the user code before any templates are applied).
teaserContext :: Snapshot -> Context String
teaserContext snapshot = field "teaser" $ \item ->
(needlePrefix teaserSeparator . itemBody) <$>
@@ -100,7 +103,7 @@ teaserContext snapshot = field "teaser" $ \item ->
--------------------------------------------------------------------------------
teaserSeparator :: String
-teaserSeparator = "<!-- teaser_end -->"
+teaserSeparator = "<!--more-->"
--------------------------------------------------------------------------------