diff options
author | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-01-19 14:08:19 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2010-01-19 14:08:19 +0100 |
commit | f5a6c4974d561e05b2882d38b54b45188ee31185 (patch) | |
tree | 4be6d29872ef395c2bbbc1550021abb88eddf979 /src/Text/Hakyll/Render/Internal.hs | |
parent | e9dd4c75a21ee9bc8f42ea725d071974127a97d1 (diff) | |
download | hakyll-f5a6c4974d561e05b2882d38b54b45188ee31185.tar.gz |
Hakyll now passes HLint.
Diffstat (limited to 'src/Text/Hakyll/Render/Internal.hs')
-rw-r--r-- | src/Text/Hakyll/Render/Internal.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Hakyll/Render/Internal.hs b/src/Text/Hakyll/Render/Internal.hs index d4c1697..89a2709 100644 --- a/src/Text/Hakyll/Render/Internal.hs +++ b/src/Text/Hakyll/Render/Internal.hs @@ -30,10 +30,10 @@ substitute _ [] _ = [] substitute escaper string context | "$$" `isPrefixOf` string = escaper ++ substitute' (tail tail') | "$" `isPrefixOf` string = substituteKey - | otherwise = (head string) : (substitute' tail') + | otherwise = head string : substitute' tail' where tail' = tail string - (key, rest) = break (not . isAlpha) tail' + (key, rest) = span isAlpha tail' replacement = fromMaybe ('$' : key) $ M.lookup key context substituteKey = replacement ++ substitute' rest substitute' str = substitute escaper str context @@ -86,7 +86,7 @@ writePage :: Page -> Hakyll () writePage page = do additionalContext' <- askHakyll additionalContext let destination = toDestination url - context = additionalContext' `M.union` (M.singleton "root" $ toRoot url) + context = additionalContext' `M.union` M.singleton "root" (toRoot url) makeDirectories destination -- Substitute $root here, just before writing. liftIO $ writeFile destination $ finalSubstitute (getBody page) context |