summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-03-07 22:10:07 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-03-07 22:10:07 +0100
commit26b233dd7a84aae10762d06c43b05f000451c542 (patch)
tree48c669356aafd230e9490897a1f8c7b1ca6cdde2
parent29a18d618849d9b1cc06d1aecfef1294d9e00dae (diff)
downloadhakyll-26b233dd7a84aae10762d06c43b05f000451c542.tar.gz
Tag url links should be absolute
-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
--