summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/CreateContext.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2010-05-22 11:07:28 +0200
committerJasper Van der Jeugt <jaspervdj@gmail.com>2010-05-22 11:07:28 +0200
commitc31f22c79adbd1bce7876aa9eb9cfcbb9f226623 (patch)
tree5076564d0700ee940ef503bcddb9ee108562115f /src/Text/Hakyll/CreateContext.hs
parentf88a5ec2196272a0b447ccb44121fa23312a072d (diff)
downloadhakyll-c31f22c79adbd1bce7876aa9eb9cfcbb9f226623.tar.gz
Add possibility to change URL through Arrows.
Diffstat (limited to 'src/Text/Hakyll/CreateContext.hs')
-rw-r--r--src/Text/Hakyll/CreateContext.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Hakyll/CreateContext.hs b/src/Text/Hakyll/CreateContext.hs
index a23f213..1bfd00c 100644
--- a/src/Text/Hakyll/CreateContext.hs
+++ b/src/Text/Hakyll/CreateContext.hs
@@ -11,7 +11,7 @@ module Text.Hakyll.CreateContext
import qualified Data.Map as M
import Control.Arrow (second)
-import Control.Monad (liftM2, mplus)
+import Control.Monad (liftM2)
import Control.Applicative ((<$>))
import Text.Hakyll.File
@@ -25,7 +25,7 @@ import Text.Hakyll.Internal.Page
createPage :: FilePath -> HakyllAction () Context
createPage path = HakyllAction
{ actionDependencies = [path]
- , actionUrl = Just $ toUrl path
+ , actionUrl = Left $ toUrl path
, actionFunction = const (readPage path)
}
@@ -41,7 +41,7 @@ createCustomPage :: FilePath
-> HakyllAction () Context
createCustomPage url association = HakyllAction
{ actionDependencies = dataDependencies
- , actionUrl = Just $ return url
+ , actionUrl = Left $ return url
, actionFunction = \_ -> M.fromList <$> assoc'
}
where
@@ -78,7 +78,7 @@ combine :: HakyllAction () Context -> HakyllAction () Context
-> HakyllAction () Context
combine x y = HakyllAction
{ actionDependencies = actionDependencies x ++ actionDependencies y
- , actionUrl = actionUrl x `mplus` actionUrl y
+ , actionUrl = actionUrl x
, actionFunction = \_ ->
liftM2 M.union (runHakyllAction x) (runHakyllAction y)
}
@@ -90,7 +90,7 @@ combineWithUrl :: FilePath
-> HakyllAction () Context
-> HakyllAction () Context
combineWithUrl url x y = combine'
- { actionUrl = Just $ return url
+ { actionUrl = Left $ return url
, actionFunction = \_ -> M.insert "url" url <$> runHakyllAction combine'
}
where