HORIZON HASKELLDocslts/ghc-10.0.x8c2f8e82026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19

Modulehakyll-4.17.0.0Haskell2010

Hakyll.Web.Template.Internal

  • 1 type
  • 9 values
  • Packagehakyll-4.17.0.0
  • Exports10
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceInternal.hs
datadata Template
#

Datatype used for template substitutions.

Instances7Eq, Show, IsString, Generic, Binary, Writable, …
valueloadAndApplyTemplate
  1. :: Identifier

    Template identifier

  2. -> Context a

    Context

  3. -> Item a

    Page

  4. -> Compiler (Item String)

    Resulting item

#

The following pattern is so common:

tpl <- loadBody "templates/foo.html"
someCompiler
    >>= applyTemplate tpl context

That we have a single function which does this:

someCompiler
    >>= loadAndApplyTemplate "templates/foo.html" context
valueapplyAsTemplate
  1. :: Context String

    Context

  2. -> Item String

    Item and template

  3. -> Compiler (Item String)

    Resulting item

#

It is also possible that you want to substitute $key$s within the body of an item. This function does that by interpreting the item body as a template, and then applying it to itself.