hakyll-4.9.8.0: A static website compiler library

Safe Haskell | None
Language | Haskell98

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 #

Responsible for retrieving and listing resources

Instances

Show Provider # |
Methods showsPrec :: Int -> Provider -> ShowS # show :: Provider -> String # showList :: [Provider] -> ShowS #

newProvider #

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] #

resourceExists :: Provider -> Identifier -> Bool #

Check if a given resource exists

resourceFilePath :: Provider -> Identifier -> FilePath #

resourceModified :: Provider -> Identifier -> Bool #

A resource is modified if it or its metadata has changed

resourceModificationTime :: Provider -> Identifier -> UTCTime #

# Access to raw resource content

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

Get the raw body of a resource as string

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

Get the raw body of a resource of a lazy bytestring

# Access to metadata and body content

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

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