diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-04-22 20:24:19 +0200 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-04-22 20:24:19 +0200 |
commit | 2895a05a19f7cf53437d609e74ebce28c8c9be29 (patch) | |
tree | bbeda30ae63d22c9b1f58e1e369212d746d6f256 /src/Hakyll/Web | |
parent | 79215f71eb501f65d3e74fdda3e592fbcadd9c7e (diff) | |
download | hakyll-2895a05a19f7cf53437d609e74ebce28c8c9be29.tar.gz |
Micro cleanup
Diffstat (limited to 'src/Hakyll/Web')
-rw-r--r-- | src/Hakyll/Web/Tags.hs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/Hakyll/Web/Tags.hs b/src/Hakyll/Web/Tags.hs index 0bca696..bfa83e6 100644 --- a/src/Hakyll/Web/Tags.hs +++ b/src/Hakyll/Web/Tags.hs @@ -198,17 +198,15 @@ renderTagCloud :: Double -- ^ Rendered cloud renderTagCloud = renderTagCloudWith makeLink (intercalate " ") where - makeLink minSize maxSize tag url count min' max' = renderHtml $ - H.a ! A.style (toValue $ "font-size: " ++ size count min' max') - ! A.href (toValue url) - $ toHtml tag - where + makeLink minSize maxSize tag url count min' max' = -- Show the relative size of one 'count' in percent - size count min' max' = - let diff = 1 + fromIntegral max' - fromIntegral min' - relative = (fromIntegral count - fromIntegral min') / diff - size' = floor $ minSize + relative * (maxSize - minSize) - in show (size' :: Int) ++ "%" + let diff = 1 + fromIntegral max' - fromIntegral min' + relative = (fromIntegral count - fromIntegral min') / diff + size = floor $ minSize + relative * (maxSize - minSize) :: Int + in renderHtml $ + H.a ! A.style (toValue $ "font-size: " ++ show size ++ "%") + ! A.href (toValue url) + $ toHtml tag -------------------------------------------------------------------------------- |