hakyll-4.16.2.2: A static website compiler library

Safe Haskell | Safe-Inferred
Language | Haskell2010

Hakyll.Core.Provider

Contents

- Constructing resource providers
- Querying resource properties
- Access to raw resource content
- Access to metadata and body content

Description

This module provides an wrapper API around the file system which does some caching.

Synopsis

- data Provider
- newProvider :: Store -> (FilePath -> IO Bool) -> FilePath -> IO Provider
- resourceList :: Provider -> [Identifier]
- resourceExists :: Provider -> Identifier -> Bool
- resourceFilePath :: Provider -> Identifier -> FilePath
- resourceModified :: Provider -> Identifier -> Bool
- resourceModificationTime :: Provider -> Identifier -> UTCTime
- resourceString :: Provider -> Identifier -> IO String
- resourceLBS :: Provider -> Identifier -> IO ByteString
- resourceMetadata :: Provider -> Identifier -> IO Metadata
- resourceBody :: Provider -> Identifier -> IO String

# Constructing resource providers

data Provider Source #

Responsible for retrieving and listing resources

#### Instances

Instances details

Show Provider Source # |
Instance details Defined in Hakyll.Core.Provider.Internal Methods showsPrec :: Int -> Provider -> ShowS Source # show :: Provider -> String Source # showList :: [Provider] -> ShowS Source #

newProvider Source #

Arguments

:: Store | Store to use
-> (FilePath -> IO Bool) | Should we ignore this file?
-> FilePath | Search directory
-> IO Provider | Resulting provider

Create a resource provider

# Querying resource properties

resourceList :: Provider -> [Identifier] Source #

resourceExists :: Provider -> Identifier -> Bool Source #

Check if a given resource exists

resourceFilePath :: Provider -> Identifier -> FilePath Source #

resourceModified :: Provider -> Identifier -> Bool Source #

A resource is modified if it or its metadata has changed

resourceModificationTime :: Provider -> Identifier -> UTCTime Source #

# Access to raw resource content

resourceString :: Provider -> Identifier -> IO String Source #

Get the raw body of a resource as string

resourceLBS :: Provider -> Identifier -> IO ByteString Source #

Get the raw body of a resource of a lazy bytestring

# Access to metadata and body content

resourceMetadata :: Provider -> Identifier -> IO Metadata Source #

resourceBody :: Provider -> Identifier -> IO String Source #