hakyllbars-1.0.1.0: A Hakyll compiler for Handlebars-like templates
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hakyllbars.Field

Synopsis

Documentation

defaultDateConfigWith :: TimeLocale -> ZonedTime -> DateConfig Source #

Creates a default date configuration with the given locale and current time.

dateFields :: DateConfig -> Context a Source #

Creates a default date fields configuration with the given date config.

gitFields Source #

Arguments

:: String

The configured hakyll provider directory.

-> String

The base url to the online git repository for browsing.

-> Context a 

The Git fields configuration.

escapeHtmlField :: Context String Source #

Escapes HTML before interpolating in a template.

escapeHtmlUriField :: Context String Source #

Escapes HTML URI before interpolating in a template.

defaultFields :: String -> String -> Context String Source #

The default recommended fields to use for your website templates.

emptyString :: ContextValue a Source #

An empty string context value.

defaultKeys :: [String] -> Context a Source #

A context with the given keys and empty string values.

includeField :: String -> Maybe FilePath -> Maybe FilePath -> Context String Source #

Includes the given file in the template.

layoutField :: String -> FilePath -> Maybe FilePath -> Context String Source #

Sets a layout to interpolate the template into.

ifField :: forall a. String -> Context a Source #

Conditionally renders a block.

forField :: String -> Context String Source #

Context field for iterating over a list of items.

withField :: String -> Context String Source #

Sets a scope in which the given fields are active in the context.

defaultField :: forall a. String -> Context a Source #

Gets a default context value if none is provided.

linkedTitleField :: String -> String -> String -> Context String Source #

Creates a link with the title to the given item.

metadataField :: forall a. Context a Source #

siteUrlField :: String -> String -> String -> Context a Source #

The absolute url to the site root.

urlField :: String -> String -> Context a Source #

The url path to the given item.

absUrlField :: String -> String -> String -> Context a Source #

Gets the absolute url to the current item.

getUrlField :: String -> String -> Context a Source #

Gets the url path to the given item file path.

getAbsUrlField :: forall a. String -> String -> String -> Context a Source #

Gets the absolute url to the given item file path.

titleFromFileField :: String -> Context a Source #

Gets the title of the current item from the file name.

teaserField :: String -> Snapshot -> Context String Source #

Extracts the teaser from the current item.

The teaser is noted in the item body with the HTML comment `!--more--`. All content preceding this comment is considered the teaser.

metadataPriorityField Source #

Arguments

:: String

The context key.

-> [String]

The list of metadata keys to try in order of priority.

-> Context a 

Gets the value of the first metadata key that exists.

addField :: forall a. String -> Context a Source #

putBlockField :: String -> Context a Source #

Puts a block of content into the context by a given name.

addBlockField :: String -> Context a Source #

Adds a block of content to the given context collection identified by a name.