hakyll-1.4: A simple static site generator library.Source codeContentsIndex
Text.Hakyll.Renderables
Synopsis
data CustomPage
createCustomPage :: String -> [FilePath] -> [(String, Either String (Hakyll String))] -> CustomPage
createListing :: Renderable a => String -> FilePath -> [a] -> [(String, String)] -> CustomPage
createListingWith :: Renderable a => ContextManipulation -> String -> FilePath -> [a] -> [(String, String)] -> CustomPage
data PagePath
createPagePath :: FilePath -> PagePath
data CombinedRenderable a b
combine :: (Renderable a, Renderable b) => a -> b -> CombinedRenderable a b
combineWithUrl :: (Renderable a, Renderable b) => FilePath -> a -> b -> CombinedRenderable a b
Documentation
data CustomPage Source
A custom page.
show/hide Instances
createCustomPageSource
:: StringDestination of the page, relative to _site.
-> [FilePath]Dependencies of the page.
-> [(String, Either String (Hakyll String))]Mapping.
-> CustomPage

Create a custom page.

The association list given maps keys to values for substitution. Note that as value, you can either give a String or a Hakyll String. A Hakyll String is preferred for more complex data, since it allows dependency checking. A String is obviously more simple to use in some cases.

createListingSource
:: Renderable a
=> StringTemplate to render all items with.
-> FilePathRenderables in the list.
-> [a]Additional context.
-> [(String, String)]
-> CustomPage

A createCustomPage function specialized in creating listings.

This function creates a listing of a certain list of Renderables. Every item in the list is created by applying the given template to every renderable. You can also specify additional context to be included in the CustomPage.

 let customPage = createListingWith 
                      "index.html" -- Destination of the page.
                      "templates/postitem.html" -- Path to template to
                                                -- render the items with.
                      posts -- ^ Renderables to create the list with.
                      [("title", "Home")] -- ^ Additional context
createListingWithSource
:: Renderable a
=> ContextManipulationDestination of the page.
-> StringTemplate to render all items with.
-> FilePathRenderables in the list.
-> [a]Additional context.
-> [(String, String)]
-> CustomPage

A createCustomPage function specialized in creating listings.

In addition to createListing, this function allows you to specify an extra ContextManipulation for all Renderables given.

data PagePath Source
PagePath is a class that wraps a FilePath. This is used to render Pages without reading them first through use of caching.
show/hide Instances
createPagePath :: FilePath -> PagePathSource
Create a PagePath from a FilePath.
data CombinedRenderable a b Source
A combination of two other renderables.
show/hide Instances
combine :: (Renderable a, Renderable b) => a -> b -> CombinedRenderable a bSource

Combine two renderables. The url will always be taken from the first Renderable. Also, if a `$key` is present in both renderables, the value from the first Renderable will be taken as well.

Since renderables are always more or less key-value maps, you can see this as a union between two maps.

combineWithUrl :: (Renderable a, Renderable b) => FilePath -> a -> b -> CombinedRenderable a bSource
Combine two renderables and set a custom URL. This behaves like combine, except that for the url field, the given URL is always chosen.
Produced by Haddock version 2.6.0