diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2016-01-31 17:26:49 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2016-01-31 17:26:49 +0100 |
commit | 6eb19c9eaacb6c9d0b1f9c3717bcaebbbf7cea19 (patch) | |
tree | 31c23f03e0aa3bfa6e2f6dda6827406cd618c184 /src | |
parent | 5f0bdeabaafb696753d491b35eeee86f69d57507 (diff) | |
parent | 5a4ae4147313f52d50ff3bd9d74340a86175a5d9 (diff) | |
download | hakyll-6eb19c9eaacb6c9d0b1f9c3717bcaebbbf7cea19.tar.gz |
Merge pull request #385 from bergus/template
templateCompiler compiles resource body only
Diffstat (limited to 'src')
-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 |