hakyll-dir-list- Allow Hakyll to create hierarchical menues from directories.

Safe HaskellNone




data Configuration Source #

Configuration for allowing variation of collection and item tags in dependency of the hierarchical directory level. The level count begins with zero.




Default Configuration Source # 
Instance details

Defined in Hakyll.Web.Template.DirList


def :: Configuration #

defaultConfiguration :: Configuration Source #

Default configuration for dirListField

metadataConfiguration :: Metadata -> Configuration -> Configuration Source #

Read Configuration from Metadata the given default Configuration is used if no coresponding metadata field is found. The fields are: beginItemTag, endItemTag, beginCollectionTag, endCollectionTag These fields can hold a list of tags which are separated by the value of the field tagDelimiter, or if not given an ','. The list holds the tags per level, if level is higher than the tags in the list the last tag is used. Use a hyphen - to get an empty string as tag.

dirListField :: Configuration -> String -> Context a -> Compiler [Item a] -> Context b Source #

The exported dirListField function is similar to the listField template function but creates additional context information which can be used in the template to create a hierarchical menu.

Context usable inside the template

injects <li> and <ul> tags if apropriate
contains the corresponding </li> and </ul> tags
is the hyphen seperated path of the page

Metainformation in the source files

For each subdirectory which should be processed one source file with the same base name should exist which can contain meta information:

top page for directory a
page foo within a

The following meta information can be given

part of the generated id, if not given the base name of the file
give an ordering key for sorting in the current directory level, if not given the page-id will be used