summaryrefslogtreecommitdiff
path: root/src/Hakyll
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2012-05-29 23:39:07 +0200
committerJasper Van der Jeugt <m@jaspervdj.be>2012-05-29 23:39:07 +0200
commita27e254e0b1f9359653aa378565cc867049342e2 (patch)
treeb019f605737f7db47950750ea4272b66f4640cc0 /src/Hakyll
parentb182541b587a1d79d7c3794afadb41de9907a70d (diff)
downloadhakyll-a27e254e0b1f9359653aa378565cc867049342e2.tar.gz
Add constRoute
Closes #67
Diffstat (limited to 'src/Hakyll')
-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 f351447..c4a0db4 100644
--- a/src/Hakyll/Core/Routes.hs
+++ b/src/Hakyll/Core/Routes.hs
@@ -33,6 +33,7 @@ module Hakyll.Core.Routes
, setExtension
, matchRoute
, customRoute
+ , constRoute
, gsubRoute
, composeRoutes
) where
@@ -99,6 +100,11 @@ matchRoute pattern (Routes route) = Routes $ \id' ->
customRoute :: (Identifier a -> FilePath) -> Routes
customRoute f = Routes $ Just . f . castIdentifier
+-- | A route that always gives the same result. Obviously, you should only use
+-- this for a single compilation rule.
+constRoute :: FilePath -> Routes
+constRoute = customRoute . const
+
-- | Create a gsub route
--
-- Example: