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

Hakyllbars.Field.Date

Synopsis

Documentation

data DateConfig Source #

Constructors

DateConfig 

Fields

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.

dateFormatField :: String -> TimeLocale -> Context a Source #

Gets a date formatted with the given format.

dateField :: String -> TimeLocale -> ZonedTime -> Context a Source #

Gets the date relative to the configured time locale and current time from the "date" or "published" fields.

publishedField :: String -> TimeLocale -> Context a Source #

Gets the published date of an item from the metadata fields "published" or "date".

updatedField :: String -> TimeLocale -> Context a Source #

Gets the updated date of an item from the metadata fields "updated", "published", or "date".

getLastModifiedDate :: TimeLocale -> Item a -> Compiler ZonedTime Source #

Gets the last modified date of an item from the metadata fields "updated", "published", or "date", or the file path if it contains a date.

isPublishedField :: String -> Context a Source #

Gets whether the item is published.

isUpdatedField :: String -> Context a Source #

Gets whether the item has been updated.

dateFromMetadata Source #

Arguments

:: TimeLocale

The time locale to use.

-> [String]

The list of metadata keys to search for.

-> Metadata 
-> Maybe String 

Gets a date from the given metadata fields.