From a97b74b0d2f72722cd86619c01878acb01aa5167 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Tue, 20 Nov 2012 21:57:15 +0100 Subject: Port page list module a bit --- src/Hakyll/Core/Provider/MetadataCache.hs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/Hakyll/Core') diff --git a/src/Hakyll/Core/Provider/MetadataCache.hs b/src/Hakyll/Core/Provider/MetadataCache.hs index 03652e7..b813303 100644 --- a/src/Hakyll/Core/Provider/MetadataCache.hs +++ b/src/Hakyll/Core/Provider/MetadataCache.hs @@ -6,6 +6,10 @@ module Hakyll.Core.Provider.MetadataCache ) where +-------------------------------------------------------------------------------- +import qualified Data.Map as M + + -------------------------------------------------------------------------------- import Hakyll.Core.Identifier import Hakyll.Core.Metadata @@ -16,11 +20,13 @@ import qualified Hakyll.Core.Store as Store -------------------------------------------------------------------------------- resourceMetadata :: Provider -> Identifier -> IO Metadata -resourceMetadata p r = do - load p r - Store.Found md <- Store.get (providerStore p) - [name, toFilePath r, "metadata"] - return md +resourceMetadata p r + | not (resourceExists p r) = return M.empty + | otherwise = do + load p r + Store.Found md <- Store.get (providerStore p) + [name, toFilePath r, "metadata"] + return md -------------------------------------------------------------------------------- -- cgit v1.2.3