This module provides an API for resource providers. Resource providers allow Hakyll to get content from resources; the type of resource depends on the concrete instance.
A resource is represented by the Resource
type. This is basically just a
newtype wrapper around Identifier
-- but it has an important effect: it
guarantees that a resource with this identifier can be provided by one or
more resource providers.
Therefore, it is not recommended to read files directly -- you should use the
provided Resource
methods.
- newtype Resource = Resource {}
- data ResourceProvider = ResourceProvider {
- resourceList :: [Resource]
- resourceString :: Resource -> IO String
- resourceLazyByteString :: Resource -> IO ByteString
- resourceExists :: ResourceProvider -> Identifier -> Bool
- resourceDigest :: ResourceProvider -> Resource -> IO [Word8]
- resourceModified :: ResourceProvider -> Resource -> Store -> IO Bool
Documentation
A resource
Invariant: the resource specified by the given identifier must exist
data ResourceProvider Source
A value responsible for retrieving and listing resources
ResourceProvider | |
|
resourceExists :: ResourceProvider -> Identifier -> BoolSource
Check if a given identifier has a resource
resourceDigest :: ResourceProvider -> Resource -> IO [Word8]Source
Retrieve a digest for a given resource
resourceModified :: ResourceProvider -> Resource -> Store -> IO BoolSource
Check if a resource was modified