on master help sign in
Tag url links should be absolute
commit26b233dd7a84aae10762d06c43b05f000451c542 authorJasper Van der Jeugt <jaspervdj@gmail.com> dateMon 7 Mar 2011, 22:10 (16 years ago) parent29a18d6
2 files changed+3−2
src/Hakyll/Web/Tags.hs+1−1 src/Hakyll/Web/Util/Url.hs+2−1
src/Hakyll/Web/Tags.hs+1−1
@@ -138,7 +138,7 @@ renderTagCloud makeUrl minSize maxSize = proc (Tags tags) -> do
138138 -- Create a link for one item
139139 makeLink ((tag, url), count) =
140140 H.a ! A.style (toValue $ "font-size: " ++ size count)
141− ! A.href (toValue $ fromMaybe "/" url)
141+ ! A.href (toValue $ toUrl $ fromMaybe "/" url)
142142 $ toHtml tag
143143
144144 -- Render and return the HTML
src/Hakyll/Web/Util/Url.hs+2−1
@@ -18,7 +18,8 @@ import System.FilePath (splitPath, takeDirectory, joinPath)
1818-- > "/foo/bar.html"
1919--
2020toUrl :: FilePath -> String
21−toUrl = ('/' :)
21+toUrl ('/' : xs) = '/' : xs
22+toUrl url = '/' : url
2223
2324-- | Get the relative url to the site root, for a given (absolute) url
2425--