diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-20 21:57:15 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-20 21:57:15 +0100 |
commit | a97b74b0d2f72722cd86619c01878acb01aa5167 (patch) | |
tree | fbd34eff28e1f2defb1afc4d2334e8b37d3fc7bf /src/Hakyll/Core | |
parent | b5adcb69d1cd26e613c5c56c85307050bb8297cf (diff) | |
download | hakyll-a97b74b0d2f72722cd86619c01878acb01aa5167.tar.gz |
Port page list module a bit
Diffstat (limited to 'src/Hakyll/Core')
-rw-r--r-- | src/Hakyll/Core/Provider/MetadataCache.hs | 16 |
1 files changed, 11 insertions, 5 deletions
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 @@ -7,6 +7,10 @@ module Hakyll.Core.Provider.MetadataCache -------------------------------------------------------------------------------- +import qualified Data.Map as M + + +-------------------------------------------------------------------------------- import Hakyll.Core.Identifier import Hakyll.Core.Metadata import Hakyll.Core.Provider.Internal @@ -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 -------------------------------------------------------------------------------- |