on master help sign in
Add getIdentifiers
commit041ec5c3096684d045637ddd72741192b9050e36 authorJasper Van der Jeugt <jaspervdj@gmail.com> dateMon 4 Apr 2011, 22:58 (16 years ago) parent8b5347e
1 file changed+8
src/Hakyll/Core/Compiler.hs+8
src/Hakyll/Core/Compiler.hs+8
@@ -89,6 +89,7 @@ module Hakyll.Core.Compiler
8989 ( Compiler
9090 , runCompiler
9191 , getIdentifier
92+ , getIdentifiers
9293 , getRoute
9394 , getRouteFor
9495 , getResourceString
@@ -165,6 +166,13 @@ runCompiler compiler identifier provider routes store modified logger = do
165166getIdentifier :: Compiler a Identifier
166167getIdentifier = fromJob $ const $ CompilerM $ compilerIdentifier <$> ask
167168
169+-- | Get all identifiers matching the given pattern
170+--
171+getIdentifiers :: Pattern -> Compiler a [Identifier]
172+getIdentifiers pattern = fromJob $ const $ CompilerM $
173+ matches pattern . map unResource . resourceList
174+ . compilerResourceProvider <$> ask
175+
168176-- | Get the route we are using for this item
169177--
170178getRoute :: Compiler a (Maybe FilePath)