Add getIdentifiers
This commit is contained in:
parent
8b5347eb26
commit
041ec5c309
1 changed files with 8 additions and 0 deletions
|
@ -89,6 +89,7 @@ module Hakyll.Core.Compiler
|
||||||
( Compiler
|
( Compiler
|
||||||
, runCompiler
|
, runCompiler
|
||||||
, getIdentifier
|
, getIdentifier
|
||||||
|
, getIdentifiers
|
||||||
, getRoute
|
, getRoute
|
||||||
, getRouteFor
|
, getRouteFor
|
||||||
, getResourceString
|
, getResourceString
|
||||||
|
@ -165,6 +166,13 @@ runCompiler compiler identifier provider routes store modified logger = do
|
||||||
getIdentifier :: Compiler a Identifier
|
getIdentifier :: Compiler a Identifier
|
||||||
getIdentifier = fromJob $ const $ CompilerM $ compilerIdentifier <$> ask
|
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
|
-- | Get the route we are using for this item
|
||||||
--
|
--
|
||||||
getRoute :: Compiler a (Maybe FilePath)
|
getRoute :: Compiler a (Maybe FilePath)
|
||||||
|
|
Loading…
Reference in a new issue