@@ -10,7 +10,7 @@ module Hakyll.Core.Compiler
10 , getResourceBody
10 , getResourceBody
11 , getResourceString
11 , getResourceString
12 , getResourceLBS
12 , getResourceLBS
13− , getResourceWith
13+ , getResourceFilePath
15 , Internal.Snapshot
15 , Internal.Snapshot
16 , saveSnapshot
16 , saveSnapshot
@@ -98,6 +98,15 @@ getResourceLBS :: Compiler (Item ByteString)
98getResourceLBS = getResourceWith resourceLBS
98getResourceLBS = getResourceWith resourceLBS
101+--------------------------------------------------------------------------------
102+-- | Get the file path of the resource we are compiling
103+getResourceFilePath :: Compiler FilePath
104+getResourceFilePath = do
105+ provider <- compilerProvider <$> compilerAsk
106+ id' <- compilerUnderlying <$> compilerAsk
107+ return $ resourceFilePath provider id'
101--------------------------------------------------------------------------------
110--------------------------------------------------------------------------------
102-- | Overloadable function for 'getResourceString' and 'getResourceLBS'
111-- | Overloadable function for 'getResourceString' and 'getResourceLBS'
103getResourceWith :: (Provider -> Identifier -> IO a) -> Compiler (Item a)
112getResourceWith :: (Provider -> Identifier -> IO a) -> Compiler (Item a)