hakyll-2.1: A simple static site generator library.



Module containing rendering functions. All these functions are used to render files to the _site directory.





:: FilePath

Template to use for rendering.

-> HakyllAction Context Context

The render computation.

This is the most simple render action. You render a Context with a template, and get back the result.

renderAndConcat :: [FilePath] -> [HakyllAction () Context] -> HakyllAction () StringSource

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

  • Takes every Context.
  • Renders every Context with all given templates. This is comparable with a renderChain action.
  • Concatenates the result and returns that as a String.

renderChain :: [FilePath] -> HakyllAction () Context -> 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.

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.

writePage :: HakyllAction Context ()Source

Write a page to the site destination. Final action after render chains and such.