@@ -18,6 +18,7 @@ import Data.Maybe
1818import System.FilePath
1919import System.IO
2020
21+import Text.Hakyll.Util
2122import Text.Pandoc
2223
2324-- | A Page is basically key-value mapping. Certain keys have special
@@ -27,7 +28,6 @@ type Page = M.Map String PageValue
2728-- | We use a ByteString for obvious reasons.
2829type PageValue = B.ByteString
2930
30−
3131-- | Add a key-value mapping to the Page.
3232addContext :: String -> String -> Page -> Page
3333addContext key value = M.insert key (B.pack value)
@@ -61,8 +61,8 @@ readMetaData handle = do
6161 line <- hGetLine handle
6262 if isDelimiter line then return []
6363 else do others <- readMetaData handle
64− return $ (trim . break (== ':')) line : others
65− where trim (key, value) = (key, dropWhile (`elem` ": ") value)
64+ return $ (trimPair . break (== ':')) line : others
65+ where trimPair (key, value) = (trim key, trim $ tail value)
6666
6767isDelimiter :: String -> Bool
6868isDelimiter = L.isPrefixOf "---"