summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core/Compiler.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hakyll/Core/Compiler.hs')
-rw-r--r--src/Hakyll/Core/Compiler.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Hakyll/Core/Compiler.hs b/src/Hakyll/Core/Compiler.hs
index 2164dda..6960fd1 100644
--- a/src/Hakyll/Core/Compiler.hs
+++ b/src/Hakyll/Core/Compiler.hs
@@ -93,6 +93,7 @@ module Hakyll.Core.Compiler
( Compiler
, runCompiler
, getIdentifier
+ , getResource
, getRoute
, getRouteFor
, getResourceString
@@ -173,6 +174,11 @@ runCompiler compiler id' provider universe routes store modified logger = do
getIdentifier :: Compiler a Identifier
getIdentifier = fromJob $ const $ CompilerM $ compilerIdentifier <$> ask
+-- | Get the resource that is currently being compiled
+--
+getResource :: Compiler a Resource
+getResource = getIdentifier >>> arr fromIdentifier
+
-- | Get the route we are using for this item
--
getRoute :: Compiler a (Maybe FilePath)