summaryrefslogtreecommitdiff
path: root/src/Hakyll/Web
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2012-12-13 11:09:11 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2012-12-13 11:09:11 +0100
commit33fdc412ce8c8276aa620b87faa130b4bbb18267 (patch)
tree72ae1e9f990b629ebcda1c1bc3b320a35d7b6745 /src/Hakyll/Web
parent00262e3f6dd84ac9f44d7b1f23111336ef937c5e (diff)
downloadhakyll-33fdc412ce8c8276aa620b87faa130b4bbb18267.tar.gz
Improve tags module a little
Diffstat (limited to 'src/Hakyll/Web')
-rw-r--r--src/Hakyll/Web/Tags.hs22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/Hakyll/Web/Tags.hs b/src/Hakyll/Web/Tags.hs
index ae70568..a2e4544 100644
--- a/src/Hakyll/Web/Tags.hs
+++ b/src/Hakyll/Web/Tags.hs
@@ -225,12 +225,12 @@ renderTagList = renderTags makeLink (intercalate ", ")
-- > "tags" (fromCapture "tags/*")
tagsFieldWith :: (Identifier -> Compiler [String]) -- ^ Get the tags
-> String -- ^ Destination key
- -> (String -> Identifier) -- ^ Create a link for a tag
+ -> Tags -- ^ Tags structure
-> Context a -- ^ Resulting context
-tagsFieldWith getTags' key makeTagId = field key $ \item -> do
- tags <- getTags' $ itemIdentifier item
- links <- forM tags $ \tag -> do
- route' <- getRoute $ makeTagId tag
+tagsFieldWith getTags' key tags = field key $ \item -> do
+ tags' <- getTags' $ itemIdentifier item
+ links <- forM tags' $ \tag -> do
+ route' <- getRoute $ tagsMakeId tags tag
return $ renderLink tag route'
return $ renderHtml $ mconcat $ intersperse ", " $ catMaybes $ links
@@ -243,17 +243,17 @@ tagsFieldWith getTags' key makeTagId = field key $ \item -> do
--------------------------------------------------------------------------------
-- | Render tags with links
-tagsField :: String -- ^ Destination key
- -> (String -> Identifier) -- ^ Create a link for a tag
- -> Context a -- ^ Context
+tagsField :: String -- ^ Destination key
+ -> Tags -- ^ Tags
+ -> Context a -- ^ Context
tagsField = tagsFieldWith getTags
--------------------------------------------------------------------------------
-- | Render the category in a link
-categoryField :: String -- ^ Destination key
- -> (String -> Identifier) -- ^ Create a category link
- -> Context a -- ^ Context
+categoryField :: String -- ^ Destination key
+ -> Tags -- ^ Tags
+ -> Context a -- ^ Context
categoryField = tagsFieldWith getCategory