summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Routes.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-02-11 08:20:35 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-02-11 08:20:35 +0100
commit84d920432c3397aab86414892b4766506236bc4c (patch)
tree66b45bf6560c18d848a205cc33d1b54d24662c50 /src/Hakyll/Core/Routes.hs
parent38290835769494b555edd092d79e9523ea854531 (diff)
downloadhakyll-84d920432c3397aab86414892b4766506236bc4c.tar.gz
Add customRoute
Diffstat (limited to 'src/Hakyll/Core/Routes.hs')
-rw-r--r--src/Hakyll/Core/Routes.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Hakyll/Core/Routes.hs b/src/Hakyll/Core/Routes.hs
index c1a034f..b6e1c12 100644
--- a/src/Hakyll/Core/Routes.hs
+++ b/src/Hakyll/Core/Routes.hs
@@ -12,6 +12,7 @@ module Hakyll.Core.Routes
, idRoute
, setExtension
, ifMatch
+ , customRoute
) where
import Data.Monoid (Monoid, mempty, mappend)
@@ -69,3 +70,8 @@ ifMatch :: Pattern -> Routes -> Routes
ifMatch pattern (Routes route) = Routes $ \id' ->
if doesMatch pattern id' then route id'
else Nothing
+
+-- | Create a custom route. This should almost always be used with 'ifMatch'.
+--
+customRoute :: (Identifier -> FilePath) -> Routes
+customRoute f = Routes $ Just . f