diff options
Diffstat (limited to 'src/Hakyll/Core/Resource/Provider')
-rw-r--r-- | src/Hakyll/Core/Resource/Provider/File.hs | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/Hakyll/Core/Resource/Provider/File.hs b/src/Hakyll/Core/Resource/Provider/File.hs index 5383b51..8365a5d 100644 --- a/src/Hakyll/Core/Resource/Provider/File.hs +++ b/src/Hakyll/Core/Resource/Provider/File.hs @@ -5,8 +5,6 @@ module Hakyll.Core.Resource.Provider.File ) where import Control.Applicative ((<$>)) -import Control.Concurrent (newMVar) -import qualified Data.Map as M import qualified Data.ByteString.Lazy as LB @@ -20,16 +18,7 @@ import Hakyll.Core.Configuration fileResourceProvider :: HakyllConfiguration -> IO ResourceProvider fileResourceProvider configuration = do -- Retrieve a list of paths - list <- filter (not . ignoreFile configuration) <$> + list <- map Resource . filter (not . ignoreFile configuration) <$> getRecursiveContents False "." - - -- MVar for the cache - mvar <- newMVar M.empty - - -- Construct a resource provider - return ResourceProvider - { resourceList = map Resource list - , resourceString = readFile . unResource - , resourceLazyByteString = LB.readFile . unResource - , resourceModifiedCache = mvar - } + makeResourceProvider list (readFile . unResource) + (LB.readFile . unResource) |