blob: 442ae9aff382cb294186c06fcd2355ba2037929c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
-- | A concrete 'ResourceProvider' that gets it's resources from the filesystem
--
module Hakyll.Core.ResourceProvider.FileResourceProvider
( fileResourceProvider
) where
import Control.Applicative ((<$>))
import Hakyll.Core.ResourceProvider
import Hakyll.Core.Identifier
import Hakyll.Core.Util.File
-- | Create a filesystem-based 'ResourceProvider'
--
fileResourceProvider :: IO ResourceProvider
fileResourceProvider = do
list <- map parseIdentifier <$> getRecursiveContents "."
return $ ResourceProvider
{ resourceList = list
, resourceString = readFile . toFilePath
}
|