diff options
Diffstat (limited to 'src/Hakyll/Core/Resource/Provider')
-rw-r--r-- | src/Hakyll/Core/Resource/Provider/Dummy.hs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Hakyll/Core/Resource/Provider/Dummy.hs b/src/Hakyll/Core/Resource/Provider/Dummy.hs new file mode 100644 index 0000000..bc0b16d --- /dev/null +++ b/src/Hakyll/Core/Resource/Provider/Dummy.hs @@ -0,0 +1,21 @@ +-- | Dummy resource provider for testing purposes +-- +module Hakyll.Core.Resource.Provider.Dummy + ( dummyResourceProvider + ) where + +import Data.Map (Map) +import qualified Data.Map as M + +import qualified Data.ByteString.Lazy.Char8 as LBC + +import Hakyll.Core.Resource +import Hakyll.Core.Resource.Provider + +-- | Create a dummy 'ResourceProvider' +-- +dummyResourceProvider :: Map String String -> IO ResourceProvider +dummyResourceProvider vfs = makeResourceProvider + (map Resource (M.keys vfs)) + (return . (vfs M.!) . unResource) + (return . LBC.pack . (vfs M.!) . unResource) |