@@ -12,6 +12,7 @@ module Hakyll.Core.Routes
1212 , idRoute
1313 , setExtension
1414 , ifMatch
15+ , customRoute
1516 ) where
1617
1718import Data.Monoid (Monoid, mempty, mappend)
@@ -69,3 +70,8 @@ ifMatch :: Pattern -> Routes -> Routes
6970ifMatch pattern (Routes route) = Routes $ \id' ->
7071 if doesMatch pattern id' then route id'
7172 else Nothing
73+
74+-- | Create a custom route. This should almost always be used with 'ifMatch'.
75+--
76+customRoute :: (Identifier -> FilePath) -> Routes
77+customRoute f = Routes $ Just . f