hakyll-0.1: A simple static site generator library.Source codeContentsIndex
Text.Hakyll.Page
Synopsis
type Page = Map String PageValue
type PageValue = ByteString
addContext :: String -> String -> Page -> Page
getURL :: Page -> String
getBody :: Page -> PageValue
readPage :: FilePath -> IO Page
pageFromList :: [(String, String)] -> Page
concatPages :: [Page] -> PageValue
concatPagesWith :: String -> [Page] -> PageValue
Documentation
type Page = Map String PageValueSource
A Page is basically key-value mapping. Certain keys have special meanings, like for example url, body and title.
type PageValue = ByteStringSource
We use a ByteString for obvious reasons.
addContext :: String -> String -> Page -> PageSource
Add a key-value mapping to the Page.
getURL :: Page -> StringSource
Get the URL for a certain page. This should always be defined. If not, it will return trash.html.
getBody :: Page -> PageValueSource
Get the body for a certain page. When not defined, the body will be empty.
readPage :: FilePath -> IO PageSource
Read a page from a file. Metadata is supported, and if the filename has a .markdown extension, it will be rendered using pandoc. Note that pages are not templates, so they should not contain $identifiers.
pageFromList :: [(String, String)] -> PageSource
Create a key-value mapping page from an association list.
concatPages :: [Page] -> PageValueSource
Concat the bodies of pages, and return the result.
concatPagesWithSource
:: StringKey of which to concat the values.
-> [Page]Pages to get the values from.
-> PageValueThe concatenation.
Concat certain values of pages, and return the result.
Produced by Haddock version 2.6.0