diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2015-06-30 11:51:06 +0200 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2015-06-30 11:51:53 +0200 |
commit | f9872ba1bb06e2af30639a8cadc26004afcd5ca3 (patch) | |
tree | e8d0d20c1a03f030f01d5eb46a2a03b6dfb3efaf /src/Hakyll/Web/Template | |
parent | 43c4e2a82e080ea63dd25dff7df270e30d0e65d6 (diff) | |
download | hakyll-f9872ba1bb06e2af30639a8cadc26004afcd5ca3.tar.gz |
Allow empty template, fix some import warnings
Closes #355
Diffstat (limited to 'src/Hakyll/Web/Template')
-rw-r--r-- | src/Hakyll/Web/Template/Context.hs | 4 | ||||
-rw-r--r-- | src/Hakyll/Web/Template/Internal.hs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/Hakyll/Web/Template/Context.hs b/src/Hakyll/Web/Template/Context.hs index f783c10..080f819 100644 --- a/src/Hakyll/Web/Template/Context.hs +++ b/src/Hakyll/Web/Template/Context.hs @@ -36,7 +36,7 @@ import qualified Data.Map as M import Data.Monoid (Monoid (..)) import Data.Time.Clock (UTCTime (..)) import Data.Time.Format (TimeLocale, defaultTimeLocale, - formatTime, parseTime) + formatTime, parseTimeM) import System.FilePath (splitDirectories, takeBaseName) @@ -282,7 +282,7 @@ getItemUTC locale id' = do where empty' = fail $ "Hakyll.Web.Template.Context.getItemUTC: " ++ "could not parse time for " ++ show id' - parseTime' = parseTime locale + parseTime' = parseTimeM True locale formats = [ "%a, %d %b %Y %H:%M:%S %Z" , "%Y-%m-%dT%H:%M:%S%Z" diff --git a/src/Hakyll/Web/Template/Internal.hs b/src/Hakyll/Web/Template/Internal.hs index b677923..2d9de5e 100644 --- a/src/Hakyll/Web/Template/Internal.hs +++ b/src/Hakyll/Web/Template/Internal.hs @@ -128,7 +128,7 @@ readTemplate input = case P.parse template "" input of -------------------------------------------------------------------------------- template :: P.Parser Template template = Template <$> - (P.many1 $ chunk <|> escaped <|> conditional <|> for <|> partial <|> expr) + (P.many $ chunk <|> escaped <|> conditional <|> for <|> partial <|> expr) -------------------------------------------------------------------------------- |