diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-05-29 23:39:07 +0200 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-05-29 23:39:07 +0200 |
commit | a27e254e0b1f9359653aa378565cc867049342e2 (patch) | |
tree | b019f605737f7db47950750ea4272b66f4640cc0 /src/Hakyll/Core | |
parent | b182541b587a1d79d7c3794afadb41de9907a70d (diff) | |
download | hakyll-a27e254e0b1f9359653aa378565cc867049342e2.tar.gz |
Add constRoute
Closes #67
Diffstat (limited to 'src/Hakyll/Core')
-rw-r--r-- | src/Hakyll/Core/Routes.hs | 6 |
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: |