summaryrefslogtreecommitdiff
path: root/src/Hakyll
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2016-01-31 17:26:49 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2016-01-31 17:26:49 +0100
commit6eb19c9eaacb6c9d0b1f9c3717bcaebbbf7cea19 (patch)
tree31c23f03e0aa3bfa6e2f6dda6827406cd618c184 /src/Hakyll
parent5f0bdeabaafb696753d491b35eeee86f69d57507 (diff)
parent5a4ae4147313f52d50ff3bd9d74340a86175a5d9 (diff)
downloadhakyll-6eb19c9eaacb6c9d0b1f9c3717bcaebbbf7cea19.tar.gz
Merge pull request #385 from bergus/template
templateCompiler compiles resource body only
Diffstat (limited to 'src/Hakyll')
-rw-r--r--src/Hakyll/Web/Template.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Hakyll/Web/Template.hs b/src/Hakyll/Web/Template.hs
index d28ce08..194949d 100644
--- a/src/Hakyll/Web/Template.hs
+++ b/src/Hakyll/Web/Template.hs
@@ -118,6 +118,7 @@
{-# LANGUAGE ScopedTypeVariables #-}
module Hakyll.Web.Template
( Template
+ , templateBodyCompiler
, templateCompiler
, applyTemplate
, loadAndApplyTemplate
@@ -143,7 +144,14 @@ import Hakyll.Web.Template.Internal
--------------------------------------------------------------------------------
--- | Read a template.
+-- | Read a template, without metadata header
+templateBodyCompiler :: Compiler (Item Template)
+templateBodyCompiler = cached "Hakyll.Web.Template.templateBodyCompiler" $ do
+ item <- getResourceBody
+ return $ fmap readTemplate item
+
+--------------------------------------------------------------------------------
+-- | Read complete file contents as a template
templateCompiler :: Compiler (Item Template)
templateCompiler = cached "Hakyll.Web.Template.templateCompiler" $ do
item <- getResourceString