summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-04-04 22:58:43 +0200
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-04-04 22:58:43 +0200
commit041ec5c3096684d045637ddd72741192b9050e36 (patch)
treef5f0dd57c53b53cd2f4d6e12d2981a7453467102 /src/Hakyll/Core
parent8b5347eb26c28bc3d4b80230df488c8ae959c47c (diff)
downloadhakyll-041ec5c3096684d045637ddd72741192b9050e36.tar.gz
Add getIdentifiers
Diffstat (limited to 'src/Hakyll/Core')
-rw-r--r--src/Hakyll/Core/Compiler.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Hakyll/Core/Compiler.hs b/src/Hakyll/Core/Compiler.hs
index 371594f..bd78adf 100644
--- a/src/Hakyll/Core/Compiler.hs
+++ b/src/Hakyll/Core/Compiler.hs
@@ -89,6 +89,7 @@ module Hakyll.Core.Compiler
( Compiler
, runCompiler
, getIdentifier
+ , getIdentifiers
, getRoute
, getRouteFor
, getResourceString
@@ -165,6 +166,13 @@ runCompiler compiler identifier provider routes store modified logger = do
getIdentifier :: Compiler a Identifier
getIdentifier = fromJob $ const $ CompilerM $ compilerIdentifier <$> ask
+-- | Get all identifiers matching the given pattern
+--
+getIdentifiers :: Pattern -> Compiler a [Identifier]
+getIdentifiers pattern = fromJob $ const $ CompilerM $
+ matches pattern . map unResource . resourceList
+ . compilerResourceProvider <$> ask
+
-- | Get the route we are using for this item
--
getRoute :: Compiler a (Maybe FilePath)