blob: 9f151782260eda3c99ee3700a065dd94361d722c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
-- | 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.Text.Lazy as TL
import qualified Data.Text.Lazy.Encoding as TL
import Data.ByteString.Lazy (ByteString)
import Hakyll.Core.Resource
import Hakyll.Core.Resource.Provider
-- | Create a dummy 'ResourceProvider'
--
dummyResourceProvider :: Map String ByteString -> IO ResourceProvider
dummyResourceProvider vfs = makeResourceProvider
(map Resource (M.keys vfs))
(return . TL.unpack . TL.decodeUtf8 . (vfs M.!) . unResource)
(return . (vfs M.!) . unResource)
|