hakyll-3.1.0.0: A simple static site generator library.

Hakyll.Core.Resource.Provider

Description

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.

Synopsis

Documentation

data ResourceProvider Source

A value responsible for retrieving and listing resources

Constructors

ResourceProvider 

Fields

resourceList :: [Resource]

A list of all resources this provider is able to provide

resourceString :: Resource -> IO String

Retrieve a certain resource as string

resourceLazyByteString :: Resource -> IO ByteString

Retrieve a certain resource as lazy bytestring

resourceModifiedCache :: MVar (Map Resource Bool)

Cache keeping track of modified items

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