From 26b233dd7a84aae10762d06c43b05f000451c542 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Mon, 7 Mar 2011 22:10:07 +0100 Subject: Tag url links should be absolute --- src/Hakyll/Web/Tags.hs | 2 +- src/Hakyll/Web/Util/Url.hs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Hakyll/Web/Tags.hs b/src/Hakyll/Web/Tags.hs index 211a06b..328ae8b 100644 --- a/src/Hakyll/Web/Tags.hs +++ b/src/Hakyll/Web/Tags.hs @@ -138,7 +138,7 @@ renderTagCloud makeUrl minSize maxSize = proc (Tags tags) -> do -- Create a link for one item makeLink ((tag, url), count) = H.a ! A.style (toValue $ "font-size: " ++ size count) - ! A.href (toValue $ fromMaybe "/" url) + ! A.href (toValue $ toUrl $ fromMaybe "/" url) $ toHtml tag -- Render and return the HTML diff --git a/src/Hakyll/Web/Util/Url.hs b/src/Hakyll/Web/Util/Url.hs index 54a361e..8a02ef3 100644 --- a/src/Hakyll/Web/Util/Url.hs +++ b/src/Hakyll/Web/Util/Url.hs @@ -18,7 +18,8 @@ import System.FilePath (splitPath, takeDirectory, joinPath) -- > "/foo/bar.html" -- toUrl :: FilePath -> String -toUrl = ('/' :) +toUrl ('/' : xs) = '/' : xs +toUrl url = '/' : url -- | Get the relative url to the site root, for a given (absolute) url -- -- cgit v1.2.3