summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Render
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Hakyll/Render')
-rw-r--r--src/Text/Hakyll/Render/Internal.hs9
1 files changed, 4 insertions, 5 deletions
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