diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2016-07-23 16:04:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-23 16:04:17 +0200 |
commit | 68e9c7704216f88b73162963c06ef80616ff318a (patch) | |
tree | 20decb44be8efa9dcdf3d708c23e621c9c5d008f /src/Hakyll/Web/Template.hs | |
parent | 363571f2677809973a8a48eafa37232126c78507 (diff) | |
parent | 871cfd36ddd143f8fad14657e1c1fd80a9e6c66f (diff) | |
download | hakyll-68e9c7704216f88b73162963c06ef80616ff318a.tar.gz |
Merge pull request #451 from lortabac/master
Include file name in error messages
Diffstat (limited to 'src/Hakyll/Web/Template.hs')
-rw-r--r-- | src/Hakyll/Web/Template.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Hakyll/Web/Template.hs b/src/Hakyll/Web/Template.hs index 65c4ac9..a662906 100644 --- a/src/Hakyll/Web/Template.hs +++ b/src/Hakyll/Web/Template.hs @@ -147,14 +147,16 @@ import Hakyll.Web.Template.Internal templateBodyCompiler :: Compiler (Item Template) templateBodyCompiler = cached "Hakyll.Web.Template.templateBodyCompiler" $ do item <- getResourceBody - return $ fmap readTemplate item + file <- getResourceFilePath + return $ fmap (readTemplateFile file) item -------------------------------------------------------------------------------- -- | Read complete file contents as a template templateCompiler :: Compiler (Item Template) templateCompiler = cached "Hakyll.Web.Template.templateCompiler" $ do item <- getResourceString - return $ fmap readTemplate item + file <- getResourceFilePath + return $ fmap (readTemplateFile file) item -------------------------------------------------------------------------------- @@ -259,5 +261,6 @@ applyAsTemplate :: Context String -- ^ Context -> Item String -- ^ Item and template -> Compiler (Item String) -- ^ Resulting item applyAsTemplate context item = - let tpl = readTemplate $ itemBody item + let tpl = readTemplateFile file (itemBody item) + file = toFilePath $ itemIdentifier item in applyTemplate tpl context item |