From 129ab7f31af87962f73d534b045e57cb1975690b Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Fri, 15 Jan 2010 15:41:42 +0100 Subject: Minor code cleanup. --- src/Text/Hakyll/Render/Internal.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/Text/Hakyll/Render') diff --git a/src/Text/Hakyll/Render/Internal.hs b/src/Text/Hakyll/Render/Internal.hs index e296dd2..7e5fd37 100644 --- a/src/Text/Hakyll/Render/Internal.hs +++ b/src/Text/Hakyll/Render/Internal.hs @@ -11,8 +11,7 @@ module Text.Hakyll.Render.Internal import qualified Data.Map as M import Text.Hakyll.Context (Context, ContextManipulation) -import Control.Monad.Reader (ask, liftIO) -import Control.Monad (liftM) +import Control.Monad.Reader (liftIO) import Data.List (isPrefixOf, foldl') import Data.Char (isAlpha) import Data.Maybe (fromMaybe) @@ -20,7 +19,7 @@ import Control.Parallel.Strategies (rdeepseq, ($|)) import Text.Hakyll.Renderable import Text.Hakyll.Page import Text.Hakyll.File -import Text.Hakyll.Hakyll (Hakyll, hakyllGlobalContext) +import Text.Hakyll.Hakyll -- | Substitutes `$identifiers` in the given string by values from the given -- "Context". When a key is not found, it is left as it is. You can here @@ -84,9 +83,9 @@ pureRenderChainWith manipulation templates context = -- chains and such. writePage :: Page -> Hakyll () writePage page = do - globalContext <- liftM hakyllGlobalContext ask + additionalContext' <- askHakyll additionalContext let destination = toDestination url - context = (M.singleton "root" $ toRoot url) `M.union` globalContext + context = additionalContext' `M.union` (M.singleton "root" $ toRoot url) makeDirectories destination     -- Substitute $root here, just before writing. liftIO $ writeFile destination $ finalSubstitute (getBody page) context -- cgit v1.2.3