Template: header
Template: markdown

Template engines

Amagaki supports multiple template engines. Because Amagaki is primarily an HTML generator, and because Nunjucks is a simple template engine that is fully compatible with HTML, Amagaki's core includes Nunjucks. But, any template engine is a first-party citizen of Amagaki and can be brought in using plugins.

Read Nunjucks templating guidelaunch

Template specification

Amagaki determines which template engine to used based on the file extension of the template specified by the page's $view. When using the partial loop, the partial's partial key specifies the template.

$view: /views/page.njk
- partial: hero
  # ...
- partial: columns
  # ...

Global default template

By default, if $view is not specified within _collection.yaml or within a document’s front matter, the default /views/base.njk template is used. When used in conjunction with the partial loop, this global default represents a powerful way to follow the DRY (don’t repeat yourself) concept -- avoiding specification of different $view settings – while maintaining the concept of building websites out of reusable modules.

Adding new template engines

Different template engines can be used by installing or writing an Amagaki plugin. See the template engines plugin documentation to understand how.

Learn about template engine pluginsarrow_forward

Template: footer