summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Hakyll/Core/ResourceProvider.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Hakyll/Core/ResourceProvider.hs b/src/Hakyll/Core/ResourceProvider.hs
index c522ab6..d5f2ea3 100644
--- a/src/Hakyll/Core/ResourceProvider.hs
+++ b/src/Hakyll/Core/ResourceProvider.hs
@@ -4,6 +4,7 @@
--
module Hakyll.Core.ResourceProvider
( ResourceProvider (..)
+ , resourceExists
, resourceDigest
, resourceModified
) where
@@ -29,6 +30,11 @@ data ResourceProvider = ResourceProvider
resourceLazyByteString :: Identifier -> IO LB.ByteString
}
+-- | Check if a given resource exists
+--
+resourceExists :: ResourceProvider -> Identifier -> Bool
+resourceExists provider = flip elem $ resourceList provider
+
-- | Retrieve a digest for a given resource
--
resourceDigest :: ResourceProvider -> Identifier -> IO [Word8]