hakyll-1.4: A simple static site generator library.Source codeContentsIndex
Text.Hakyll.Render
Description
Module containing rendering functions. All these functions are used to render files to the _site directory.
Synopsis
depends :: FilePath -> [FilePath] -> Hakyll () -> Hakyll ()
render :: Renderable a => FilePath -> a -> Hakyll Page
renderWith :: Renderable a => ContextManipulation -> FilePath -> a -> Hakyll Page
renderAndConcat :: Renderable a => [FilePath] -> [a] -> Hakyll String
renderAndConcatWith :: Renderable a => ContextManipulation -> [FilePath] -> [a] -> Hakyll String
renderChain :: Renderable a => [FilePath] -> a -> Hakyll ()
renderChainWith :: Renderable a => ContextManipulation -> [FilePath] -> a -> Hakyll ()
static :: FilePath -> Hakyll ()
css :: FilePath -> Hakyll ()
Documentation
dependsSource
:: FilePathFile to be rendered or created.
-> [FilePath]Files the render depends on.
-> Hakyll ()IO action to execute when the file is out of date.
-> Hakyll ()
Execute an IO action only when the cache is invalid.
renderSource
:: Renderable a
=> FilePathRenderable object to render with given template.
-> aThe body of the result will contain the render.
-> Hakyll Page
Render to a Page.
renderWithSource
:: Renderable a
=> ContextManipulationTemplate to use for rendering.
-> FilePathRenderable object to render with given template.
-> aThe body of the result will contain the render.
-> Hakyll Page
Render to a Page. This function allows you to manipulate the context first.
renderAndConcatSource
:: Renderable a
=> [FilePath]Renderables to render.
-> [a]
-> Hakyll String

Render each renderable with the given templates, then concatenate the result. So, basically this function:

  • Takes every renderable.
  • Renders every renderable with all given templates. This is comparable with a renderChain action.
  • Concatenates the result.
renderAndConcatWith :: Renderable a => ContextManipulation -> [FilePath] -> [a] -> Hakyll StringSource
Render each renderable with the given templates, then concatenate the result. This function allows you to specify a ContextManipulation to apply on every Renderable.
renderChain :: Renderable a => [FilePath] -> a -> Hakyll ()Source

Chain a render action for a page with a number of templates. This will also write the result to the site destination. This is the preferred way to do general rendering.

 renderChain [ "templates/notice.html"
             , "templates/default.html"
             ] $ createPagePath "warning.html"

This code will first render warning.html using templates/notice.html, and will then render the result with templates/default.html.

renderChainWith :: Renderable a => ContextManipulation -> [FilePath] -> a -> Hakyll ()Source
A more custom render chain that allows you to specify a ContextManipulation which to apply on the context when it is read first.
static :: FilePath -> Hakyll ()Source
Mark a certain file as static, so it will just be copied when the site is generated.
css :: FilePath -> Hakyll ()Source
Render a css file, compressing it.
Produced by Haddock version 2.6.0