summaryrefslogtreecommitdiff
path: root/src/Hakyll/Web
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hakyll/Web')
-rw-r--r--src/Hakyll/Web/Tags.hs2
-rw-r--r--src/Hakyll/Web/Util/Url.hs3
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
--