@@ -75,6 +75,7 @@ import qualified Text.Blaze.Html5.Attributes as A
7575
7676--------------------------------------------------------------------------------
7777import Hakyll.Core.Compiler
78+import Hakyll.Core.Dependencies
7879import Hakyll.Core.Identifier
7980import Hakyll.Core.Identifier.Pattern
8081import Hakyll.Core.Item
@@ -88,8 +89,9 @@ import Hakyll.Web.Urls
8889--------------------------------------------------------------------------------
8990-- | Data about tags
9091data Tags = Tags
91− { tagsMap :: [(String, [Identifier])]
92− , tagsMakeId :: String -> Identifier
92+ { tagsMap :: [(String, [Identifier])]
93+ , tagsMakeId :: String -> Identifier
94+ , tagsDependency :: Dependency
9395 } deriving (Show)
9496
9597
@@ -117,7 +119,7 @@ buildTagsWith :: MonadMetadata m
117119buildTagsWith f pattern makeId = do
118120 ids <- getMatches pattern
119121 tagMap <- foldM addTags M.empty ids
120− return $ Tags (M.toList tagMap) makeId
122+ return $ Tags (M.toList tagMap) makeId (PatternDependency pattern ids)
121123 where
122124 -- Create a tag map for one page
123125 addTags tagMap id' = do
@@ -142,7 +144,8 @@ tagsRules :: Tags -> (String -> Pattern -> Rules ()) -> Rules ()
142144tagsRules tags rules =
143145 forM_ (tagsMap tags) $ \(tag, identifiers) ->
144146 match (fromGlob $ toFilePath $ tagsMakeId tags tag) $
145− rules tag $ fromList identifiers
147+ rulesExtraDependencies [tagsDependency tags] $
148+ rules tag $ fromList identifiers
146149
147150
148151--------------------------------------------------------------------------------
@@ -154,10 +157,10 @@ renderTags :: (String -> String -> Int -> Int -> Int -> String)
154157 -> Tags
155158 -- ^ Tag cloud renderer
156159 -> Compiler String
157−renderTags makeHtml concatHtml (Tags tags makeTagId) = do
160+renderTags makeHtml concatHtml tags = do
158161 -- In tags' we create a list: [((tag, route), count)]
159− tags' <- forM tags $ \(tag, ids) -> do
160− route' <- getRoute $ makeTagId tag
162+ tags' <- forM (tagsMap tags) $ \(tag, ids) -> do
163+ route' <- getRoute $ tagsMakeId tags tag
161164 return ((tag, route'), length ids)
162165
163166 -- TODO: We actually need to tell a dependency here!