@@ -11,8 +11,7 @@ module Text.Hakyll.Render.Internal
1111
1212import qualified Data.Map as M
1313import Text.Hakyll.Context (Context, ContextManipulation)
14−import Control.Monad.Reader (ask, liftIO)
15−import Control.Monad (liftM)
14+import Control.Monad.Reader (liftIO)
1615import Data.List (isPrefixOf, foldl')
1716import Data.Char (isAlpha)
1817import Data.Maybe (fromMaybe)
@@ -20,7 +19,7 @@ import Control.Parallel.Strategies (rdeepseq, ($|))
2019import Text.Hakyll.Renderable
2120import Text.Hakyll.Page
2221import Text.Hakyll.File
23−import Text.Hakyll.Hakyll (Hakyll, hakyllGlobalContext)
22+import Text.Hakyll.Hakyll
2423
2524-- | Substitutes `$identifiers` in the given string by values from the given
2625-- "Context". When a key is not found, it is left as it is. You can here
@@ -84,9 +83,9 @@ pureRenderChainWith manipulation templates context =
8483-- chains and such.
8584writePage :: Page -> Hakyll ()
8685writePage page = do
87− globalContext <- liftM hakyllGlobalContext ask
86+ additionalContext' <- askHakyll additionalContext
8887 let destination = toDestination url
89− context = (M.singleton "root" $ toRoot url) `M.union` globalContext
88+ context = additionalContext' `M.union` (M.singleton "root" $ toRoot url)
9089 makeDirectories destination
9190 -- Substitute $root here, just before writing.
9291 liftIO $ writeFile destination $ finalSubstitute (getBody page) context