summaryrefslogtreecommitdiff
path: root/src/Hakyll
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hakyll')
-rw-r--r--src/Hakyll/Web/Tags.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Hakyll/Web/Tags.hs b/src/Hakyll/Web/Tags.hs
index 31b945f..42612a7 100644
--- a/src/Hakyll/Web/Tags.hs
+++ b/src/Hakyll/Web/Tags.hs
@@ -80,7 +80,8 @@ instance Binary a => Binary (Tags a) where
instance Writable (Tags a) where
write _ _ = return ()
--- | Obtain tags from a page
+-- | Obtain tags from a page in the default way: parse them from the @tags@
+-- metadata field.
--
getTags :: Page a -> [String]
getTags = map trim . splitAll "," . getField "tags"
@@ -181,9 +182,8 @@ renderTagList makeUrl = renderTags makeUrl makeLink (intercalate ", ")
-- | Render tags with links with custom function to get tags. It is typically
-- together with 'getTags' like this:
--
--- @
--- 'renderTagsFieldWith' (customFunction . 'getTags') \"tags\" ('fromCapture' \"tags/*\")
--- @
+-- > renderTagsFieldWith (customFunction . getTags)
+-- > "tags" (fromCapture "tags/*")
--
renderTagsFieldWith :: (Page a -> [String]) -- ^ Function to get the tags
-> String -- ^ Destination key