@@ -66,6 +66,7 @@ import qualified Text.Blaze.Html5.Attributes as A
6666--------------------------------------------------------------------------------
6767import Hakyll.Core.Compiler
6868import Hakyll.Core.Identifier
69+import Hakyll.Core.Identifier.Pattern
6970import Hakyll.Core.Item
7071import Hakyll.Core.Metadata
7172import Hakyll.Core.Util.String
@@ -102,10 +103,11 @@ getCategory = return . return . takeBaseName . takeDirectory . toFilePath
102103
103104
104105--------------------------------------------------------------------------------
105−-- | Higher-level function to read tags
106+-- | Higher-order function to read tags
106107buildTagsWith :: MonadMetadata m
107− => (Identifier -> m [String]) -> [Identifier] -> m Tags
108−buildTagsWith f ids = do
108+ => (Identifier -> m [String]) -> Pattern -> m Tags
109+buildTagsWith f pattern = do
110+ ids <- getMatches pattern
109111 tagMap <- foldM addTags M.empty ids
110112 return $ Tags $ M.toList tagMap
111113 where
@@ -117,15 +119,13 @@ buildTagsWith f ids = do
117119
118120--------------------------------------------------------------------------------
119121-- | Read a tagmap using the @tags@ metadata field
120−-- TODO: Should use pattern
121−buildTags :: MonadMetadata m => [Identifier] -> m Tags
122+buildTags :: MonadMetadata m => Pattern -> m Tags
122123buildTags = buildTagsWith getTags
123124
124125
125126--------------------------------------------------------------------------------
126127-- | Read a tagmap using the @category@ metadata field
127−-- TODO: Should use pattern
128−buildCategory :: MonadMetadata m => [Identifier] -> m Tags
128+buildCategory :: MonadMetadata m => Pattern -> m Tags
129129buildCategory = buildTagsWith getCategory
130130
131131