diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Hakyll/Web/RelativizeUrls.hs | 2 | ||||
-rw-r--r-- | src/Hakyll/Web/Util/Url.hs | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/Hakyll/Web/RelativizeUrls.hs b/src/Hakyll/Web/RelativizeUrls.hs index 2de4a0e..06b4ae2 100644 --- a/src/Hakyll/Web/RelativizeUrls.hs +++ b/src/Hakyll/Web/RelativizeUrls.hs @@ -31,7 +31,7 @@ import Hakyll.Core.Compiler import Hakyll.Web.Page import Hakyll.Web.Util.Url --- | Compiler form of 'compressCss' which automatically picks the right root +-- | Compiler form of 'relativizeUrls' which automatically picks the right root -- path -- relativizeUrlsCompiler :: Compiler (Page String) (Page String) diff --git a/src/Hakyll/Web/Util/Url.hs b/src/Hakyll/Web/Util/Url.hs index 8a02ef3..a0702d8 100644 --- a/src/Hakyll/Web/Util/Url.hs +++ b/src/Hakyll/Web/Util/Url.hs @@ -24,8 +24,10 @@ toUrl url = '/' : url -- | Get the relative url to the site root, for a given (absolute) url -- toSiteRoot :: String -> String -toSiteRoot = emptyException . joinPath . map parent . splitPath . takeDirectory +toSiteRoot = emptyException . joinPath . map parent + . splitPath . takeDirectory . dropLeadingSlash where parent = const ".." emptyException [] = "." emptyException x = x + dropLeadingSlash = dropWhile (== '/') |