summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Internal/Template.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-10-04 01:20:17 +0200
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-10-04 01:20:17 +0200
commit08c4d74a2fe9c667e725f2ebb41bc01006a703a1 (patch)
tree4134171be17ce36ca109b7fc72d574a5c2113308 /src/Text/Hakyll/Internal/Template.hs
parentcd246971582639666bb1afe1b51bbd3db1ac744a (diff)
downloadhakyll-08c4d74a2fe9c667e725f2ebb41bc01006a703a1.tar.gz
Separate pandoc from page reading, general caching
Diffstat (limited to 'src/Text/Hakyll/Internal/Template.hs')
-rw-r--r--src/Text/Hakyll/Internal/Template.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Hakyll/Internal/Template.hs b/src/Text/Hakyll/Internal/Template.hs
index 15a2c8c..9b9d9cf 100644
--- a/src/Text/Hakyll/Internal/Template.hs
+++ b/src/Text/Hakyll/Internal/Template.hs
@@ -7,6 +7,7 @@ module Text.Hakyll.Internal.Template
, finalSubstitute
) where
+import Control.Arrow ((>>>))
import Control.Applicative ((<$>))
import Data.List (isPrefixOf)
import Data.Char (isAlphaNum)
@@ -16,6 +17,8 @@ import qualified Data.Map as M
import Text.Hakyll.Context (Context (..))
import Text.Hakyll.HakyllMonad (Hakyll)
+import Text.Hakyll.HakyllAction
+import Text.Hakyll.Pandoc
import Text.Hakyll.Internal.Cache
import Text.Hakyll.Internal.Page
import Text.Hakyll.Internal.Template.Template
@@ -53,7 +56,8 @@ readTemplate path = do
where
fileName = "templates" </> path
readDefaultTemplate = do
- page <- unContext <$> readPage path
+ page <- unContext <$>
+ runHakyllAction (readPageAction path >>> renderAction)
let body = fromMaybe (error $ "No body in template " ++ fileName)
(M.lookup "body" page)
return $ fromString body