diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2016-05-17 10:53:11 -0400 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2016-05-17 10:53:11 -0400 |
commit | b1be76da5b7340dd648885e0bfdadc4cc6fa8cbf (patch) | |
tree | b04dd880369bdd04eea6eb5657a1dd3b82e0f1dc /src/Hakyll/Core/Provider | |
parent | b6dfc61f75ff48a4dacc7f21ddd0f22b1e75b780 (diff) | |
download | hakyll-b1be76da5b7340dd648885e0bfdadc4cc6fa8cbf.tar.gz |
Read `.metadata` files using bytestring
Diffstat (limited to 'src/Hakyll/Core/Provider')
-rw-r--r-- | src/Hakyll/Core/Provider/Metadata.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Hakyll/Core/Provider/Metadata.hs b/src/Hakyll/Core/Provider/Metadata.hs index 0b0291c..6285ce1 100644 --- a/src/Hakyll/Core/Provider/Metadata.hs +++ b/src/Hakyll/Core/Provider/Metadata.hs @@ -14,6 +14,7 @@ module Hakyll.Core.Provider.Metadata import Control.Arrow (second) import Control.Exception (Exception, throwIO) import Control.Monad (guard) +import qualified Data.ByteString as B import qualified Data.ByteString.Char8 as BC import Data.List.Extended (breakWhen) import qualified Data.Map as M @@ -59,7 +60,8 @@ loadMetadataHeader fp = do -------------------------------------------------------------------------------- loadMetadataFile :: FilePath -> IO Metadata loadMetadataFile fp = do - errOrMeta <- Yaml.decodeFileEither fp + fileContent <- B.readFile fp + let errOrMeta = Yaml.decodeEither' fileContent either (fail . show) return errOrMeta |