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 | |
parent | 43c4e2a82e080ea63dd25dff7df270e30d0e65d6 (diff) | |
download | hakyll-f9872ba1bb06e2af30639a8cadc26004afcd5ca3.tar.gz |
Allow empty template, fix some import warnings
Closes #355
Diffstat (limited to 'src/Hakyll')
-rw-r--r-- | src/Hakyll/Core/Item.hs | 2 | ||||
-rw-r--r-- | src/Hakyll/Preview/Poll.hs | 3 | ||||
-rw-r--r-- | src/Hakyll/Web/Template/Context.hs | 4 | ||||
-rw-r--r-- | src/Hakyll/Web/Template/Internal.hs | 2 |
4 files changed, 6 insertions, 5 deletions
diff --git a/src/Hakyll/Core/Item.hs b/src/Hakyll/Core/Item.hs index 8933d5b..840b6a8 100644 --- a/src/Hakyll/Core/Item.hs +++ b/src/Hakyll/Core/Item.hs @@ -10,7 +10,7 @@ module Hakyll.Core.Item -------------------------------------------------------------------------------- -import Control.Applicative (Applicative, (<$>), (<*>)) +import Control.Applicative ((<$>), (<*>)) import Data.Binary (Binary (..)) import Data.Foldable (Foldable (..)) import Data.Traversable (Traversable (..)) diff --git a/src/Hakyll/Preview/Poll.hs b/src/Hakyll/Preview/Poll.hs index 34eb971..318be69 100644 --- a/src/Hakyll/Preview/Poll.hs +++ b/src/Hakyll/Preview/Poll.hs @@ -14,7 +14,7 @@ import Control.Exception (AsyncException, fromException, import Control.Monad (forever, void, when) import Filesystem.Path.CurrentOS (decodeString, encodeString) import System.Directory (canonicalizePath) -import System.FilePath (pathSeparators, (</>)) +import System.FilePath (pathSeparators) import System.FSNotify (Event (..), startManager, watchTree) @@ -23,6 +23,7 @@ import Control.Concurrent (threadDelay) import Control.Exception (IOException, throw, try) import System.Directory (doesFileExist) import System.Exit (exitFailure) +import System.FilePath ((</>)) import System.IO (Handle, IOMode (ReadMode), hClose, openFile) import System.IO.Error (isPermissionError) 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) -------------------------------------------------------------------------------- |