summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Render
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-15 15:41:42 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-01-15 15:41:42 +0100
commit129ab7f31af87962f73d534b045e57cb1975690b (patch)
tree63f6f0b3d157d28c4e67311c0df797aaf6a49b4a /src/Text/Hakyll/Render
parent62330ceae51ea28f75768196ad5e3f93eb88b8a3 (diff)
downloadhakyll-129ab7f31af87962f73d534b045e57cb1975690b.tar.gz
Minor code cleanup.
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