on master help sign in
Fix filepath-1.2 issue in toSiteRoot
commit85252f8ab8fcf45b29bec76d140ec5bc067e609f authorJasper Van der Jeugt <jaspervdj@gmail.com> dateSat 19 Mar 2011, 11:31 (16 years ago) parent969d668
1 file changed+4−2
src/Hakyll/Web/Util/Url.hs+4−2
src/Hakyll/Web/Util/Url.hs+4−2
@@ -25,9 +25,11 @@ toUrl url = '/' : url
2525--
2626toSiteRoot :: String -> String
2727toSiteRoot = emptyException . joinPath . map parent
28− . splitPath . takeDirectory . dropLeadingSlash
28+ . filter relevant . splitPath . takeDirectory
2929 where
3030 parent = const ".."
3131 emptyException [] = "."
3232 emptyException x = x
33− dropLeadingSlash = dropWhile (== '/')
33+ relevant "." = False
34+ relevant "/" = False
35+ relevant _ = True