diff options
author | Bergi <a.d.bergi@web.de> | 2015-10-21 22:14:39 +0200 |
---|---|---|
committer | Bergi <a.d.bergi@web.de> | 2015-10-24 20:29:10 +0200 |
commit | 5a4ae4147313f52d50ff3bd9d74340a86175a5d9 (patch) | |
tree | 1a2ea03e694947f7f8d4b7c3b1dd123b7d9226d8 /src/Hakyll | |
parent | 8dec0a51fbcab519755147828b546abdb397fbd8 (diff) | |
download | hakyll-5a4ae4147313f52d50ff3bd9d74340a86175a5d9.tar.gz |
templateBodyCompiler compiles resource body only
and becomes the new default, instead of templateCompiler
fixes #378
Diffstat (limited to 'src/Hakyll')
-rw-r--r-- | src/Hakyll/Web/Template.hs | 10 |
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 |