@@ -28,12 +28,14 @@
28{-# LANGUAGE DeriveDataTypeable, OverloadedStrings, Arrows #-}
28{-# LANGUAGE DeriveDataTypeable, OverloadedStrings, Arrows #-}
29module Hakyll.Web.Tags
29module Hakyll.Web.Tags
30 ( Tags (..)
30 ( Tags (..)
31 , readTagsWith
32 , readTagsWith
32 , readTags
33 , readTags
33 , readCategory
34 , readCategory
34 , renderTagCloud
35 , renderTagCloud
35 , renderTagList
36 , renderTagList
36 , renderTagsField
37 , renderTagsField
38+ , renderTagsFieldWith
37 , renderCategoryField
39 , renderCategoryField
38 , sortTagsBy
40 , sortTagsBy
39 , caseInsensitiveTags
41 , caseInsensitiveTags
@@ -176,7 +178,12 @@ renderTagList makeUrl = renderTags makeUrl makeLink (intercalate ", ")
176 makeLink tag url count _ _ = renderHtml $
178 makeLink tag url count _ _ = renderHtml $
177 H.a ! A.href (toValue url) $ toHtml (tag ++ " (" ++ show count ++ ")")
179 H.a ! A.href (toValue url) $ toHtml (tag ++ " (" ++ show count ++ ")")
179−-- | Render tags with links
181+-- | Render tags with links with custom function to get tags. It is typically
182+-- together with 'getTags' like this:
185+-- 'renderTagsFieldWith' (customFunction . 'getTags') \"tags\" ('fromCapture' \"tags/*\")
181renderTagsFieldWith :: (Page a -> [String]) -- ^ Function to get the tags
188renderTagsFieldWith :: (Page a -> [String]) -- ^ Function to get the tags
182 -> String -- ^ Destination key
189 -> String -- ^ Destination key