summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Hakyll/Web/Util/Url.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Hakyll/Web/Util/Url.hs b/src/Hakyll/Web/Util/Url.hs
index a0702d8..7ab6717 100644
--- a/src/Hakyll/Web/Util/Url.hs
+++ b/src/Hakyll/Web/Util/Url.hs
@@ -25,9 +25,11 @@ toUrl url = '/' : url
--
toSiteRoot :: String -> String
toSiteRoot = emptyException . joinPath . map parent
- . splitPath . takeDirectory . dropLeadingSlash
+ . filter relevant . splitPath . takeDirectory
where
parent = const ".."
emptyException [] = "."
emptyException x = x
- dropLeadingSlash = dropWhile (== '/')
+ relevant "." = False
+ relevant "/" = False
+ relevant _ = True