incise.transformers.layout

*parse*

dynamic

*site-options*

dynamic

deflayout

macro

(deflayout sym-name doc-string? destructuring & body)

This is a helper macro for defining layout functions. A layout function at its core is just a function which takes two arguments:

site-options - Global options for the site from incise.edn parse - A Parse or map containing keys such as content and title

This macro makes it just a little bit easier to define such functions by taking care of some boiler plate stuff like using the robert.hooke with-scope macro and binind the functions arguments to site-options and parse so partials can easily access them.

defpartial

macro

(defpartial sym-name doc-string? destructuring & body)

Defines a ‘partial’ which is basically a function with some default context.

RenderableContent

protocol

members

render-content

(render-content content)

repartial

macro

(repartial to-be-replaced replacement)

Replace the given var in a layout with a new function which will be called in its place and passed the result of the fn it is replacing. Returns an empty string so it can be used in layouts without issues.

use-layout

(use-layout layout-fn)

Use the given layout function by calling it with site-options and parse.

with-normalized-params

macro

(with-normalized-params & body)