diff options
author | samgd <sam@samgd.com> | 2016-07-25 18:24:12 +0200 |
---|---|---|
committer | samgd <sam@samgd.com> | 2016-07-25 18:24:12 +0200 |
commit | 11ef948720fab551173852e0f67da04990171433 (patch) | |
tree | 94ecc6eaacc50eb019f03299f3abba393d55d8a7 /src/Hakyll/Web/Template | |
parent | 82d6402ba38b9e1ea789e83c5ea7d08bcbeff467 (diff) | |
parent | 68e9c7704216f88b73162963c06ef80616ff318a (diff) | |
download | hakyll-11ef948720fab551173852e0f67da04990171433.tar.gz |
Fix merge conflicts
Diffstat (limited to 'src/Hakyll/Web/Template')
-rw-r--r-- | src/Hakyll/Web/Template/Internal.hs | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/Hakyll/Web/Template/Internal.hs b/src/Hakyll/Web/Template/Internal.hs index 6a9947f..15266a0 100644 --- a/src/Hakyll/Web/Template/Internal.hs +++ b/src/Hakyll/Web/Template/Internal.hs @@ -7,6 +7,7 @@ module Hakyll.Web.Template.Internal , TemplateElement (..) , templateElems , readTemplateElems + , readTemplateElemsFile ) where @@ -108,7 +109,12 @@ instance Binary TemplateExpr where -------------------------------------------------------------------------------- readTemplateElems :: String -> [TemplateElement] -readTemplateElems input = case P.parse templateElems "" input of +readTemplateElems = readTemplateElemsFile "{literal}" + + +-------------------------------------------------------------------------------- +readTemplateElemsFile :: FilePath -> String -> [TemplateElement] +readTemplateElemsFile file input = case P.parse templateElems file input of Left err -> error $ "Cannot parse template: " ++ show err Right t -> t @@ -116,12 +122,12 @@ readTemplateElems input = case P.parse templateElems "" input of -------------------------------------------------------------------------------- templateElems :: P.Parser [TemplateElement] templateElems = mconcat <$> P.many (P.choice [ lift chunk - , lift escaped - , conditional - , for - , partial - , expr - ]) + , lift escaped + , conditional + , for + , partial + , expr + ]) where lift = fmap (:[]) |