diff options
Diffstat (limited to 'src/Hakyll/Util.hs')
| -rw-r--r-- | src/Hakyll/Util.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Hakyll/Util.hs b/src/Hakyll/Util.hs new file mode 100644 index 0000000..edbdb16 --- /dev/null +++ b/src/Hakyll/Util.hs @@ -0,0 +1,19 @@ +module Hakyll.Util + ( dropParentRoute + , modifyDirRoute + , modifyDirRoute_ + ) where + +import Prolog +import Hakyll +import System.FilePath + +-- | Drop some number of parent directories +dropParentRoute :: Int -> Routes +dropParentRoute n = modifyDirRoute_ $ drop n + +modifyDirRoute :: ([FilePath] -> FilePath) -> Routes +modifyDirRoute f = customRoute $ f . splitDirectories . toFilePath + +modifyDirRoute_ :: ([FilePath] -> [FilePath]) -> Routes +modifyDirRoute_ f = modifyDirRoute $ joinPath . f |
