summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Util.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2009-12-10 14:18:13 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2009-12-10 14:18:13 +0100
commit16f284d7471c5de1ae7a51521924199f6f5dc768 (patch)
tree6dd0dfda52789a4c09e7e6a520714ed4746eb9d0 /src/Text/Hakyll/Util.hs
parentc630522ec0f17fafa9b54d1c2e654580098ae5ae (diff)
downloadhakyll-16f284d7471c5de1ae7a51521924199f6f5dc768.tar.gz
Made an abstract Renderable class. Still need some cleanup now.
Diffstat (limited to 'src/Text/Hakyll/Util.hs')
-rw-r--r--src/Text/Hakyll/Util.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Text/Hakyll/Util.hs b/src/Text/Hakyll/Util.hs
index 1d79b4a..0b95927 100644
--- a/src/Text/Hakyll/Util.hs
+++ b/src/Text/Hakyll/Util.hs
@@ -1,6 +1,7 @@
module Text.Hakyll.Util
( toDestination,
toCache,
+ toURL,
makeDirectories,
getRecursiveContents,
trim,
@@ -20,6 +21,10 @@ toDestination path = "_site" </> path
toCache :: FilePath -> FilePath
toCache path = "_cache" </> path
+-- | Get the url for a given page.
+toURL :: FilePath -> FilePath
+toURL = flip addExtension ".html" . dropExtension
+
-- | Given a path to a file, try to make the path writable by making
-- all directories on the path.
makeDirectories :: FilePath -> IO ()