From a27e254e0b1f9359653aa378565cc867049342e2 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Tue, 29 May 2012 23:39:07 +0200 Subject: Add constRoute Closes #67 --- src/Hakyll/Core/Routes.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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: -- cgit v1.2.3