hakyll-4.16.2.0: A static website compiler library

Safe Haskell | Safe-Inferred
Language | Haskell2010

Hakyll.Core.Metadata

Synopsis

- type Metadata = Object
- lookupString :: String -> Metadata -> Maybe String
- lookupStringList :: String -> Metadata -> Maybe [String]
- class Monad m => MonadMetadata m where
  - getMetadata :: Identifier -> m Metadata
  - getMatches :: Pattern -> m [Identifier]
  - getAllMetadata :: Pattern -> m [(Identifier, Metadata)]
- getMetadataField :: MonadMetadata m => Identifier -> String -> m (Maybe String)
- getMetadataField' :: (MonadFail m, MonadMetadata m) => Identifier -> String -> m String
- makePatternDependency :: MonadMetadata m => Pattern -> m Dependency
- newtype BinaryMetadata = BinaryMetadata {
  - unBinaryMetadata :: Metadata
  }

# Documentation

type Metadata = Object Source #

lookupString :: String -> Metadata -> Maybe String Source #

lookupStringList :: String -> Metadata -> Maybe [String] Source #

class Monad m => MonadMetadata m where Source #

Minimal complete definition

getMetadata, getMatches

Methods

getMetadata :: Identifier -> m Metadata Source #

getMatches :: Pattern -> m [Identifier] Source #

getAllMetadata :: Pattern -> m [(Identifier, Metadata)] Source #

#### Instances

Instances details

MonadMetadata Compiler Source # | Access provided metadata from anywhere
Instance details Defined in Hakyll.Core.Compiler.Internal Methods getMetadata :: Identifier -> Compiler Metadata Source # getMatches :: Pattern -> Compiler [Identifier] Source # getAllMetadata :: Pattern -> Compiler [(Identifier, Metadata)] Source #
MonadMetadata Rules Source # |
Instance details Defined in Hakyll.Core.Rules.Internal Methods getMetadata :: Identifier -> Rules Metadata Source # getMatches :: Pattern -> Rules [Identifier] Source # getAllMetadata :: Pattern -> Rules [(Identifier, Metadata)] Source #

getMetadataField :: MonadMetadata m => Identifier -> String -> m (Maybe String) Source #

getMetadataField' :: (MonadFail m, MonadMetadata m) => Identifier -> String -> m String Source #

Version of `getMetadataField` which throws an error if the field does not exist.

makePatternDependency :: MonadMetadata m => Pattern -> m Dependency Source #

newtype BinaryMetadata Source #

Newtype wrapper for serialization.

Constructors

BinaryMetadata |

Fields

- unBinaryMetadata :: Metadata

#### Instances

Instances details

Binary BinaryMetadata Source # |
Instance details Defined in Hakyll.Core.Metadata Methods put :: BinaryMetadata -> Put Source # get :: Get BinaryMetadata Source # putList :: [BinaryMetadata] -> Put Source #