Referenz

HeroML

Syntax

HeroML has exactly two line types. Indentation is two spaces per level.

Blocks & fields

A block line starts with a type name and optional attributes and opens a block. A field line of the form key: value sets a property of the enclosing block; everything after the colon is the value (plain text, escaped on output).

heading            # block line
  level: 2         # field line
  text: From the blog

Internally a block is simply an object { type, attrs, fields, children }. Attributes and fields are merged into the block’s properties at render time.

Attributes

Attributes sit directly on the block line — handy for short values. Three forms are possible:

FormExampleYields
unquotedfeature icon=bolticon = "bolt"
quotedbutton label="Buy now"values with spaces
flagsection altalt = true

Attribute and field are equivalent; for longer or multi-line values, prefer the field.

Nesting

Lines indented one level deeper are children of the block above. This is how structures are built — buttons inside a hero, or features inside a grid.

features cols=3
  feature
    title: Reportagen
    text: Ausführliche Geschichten mit Zeit zum Erzählen.
  feature
    title: Fotostrecken
    text: Bilder, die einen Ort spürbar machen.
  feature
    title: Service
    text: Konkrete Tipps für die eigene Reise.
Result ↓
Reportagen

Ausführliche Geschichten mit Zeit zum Erzählen.

Fotostrecken

Bilder, die einen Ort spürbar machen.

Service

Konkrete Tipps für die eigene Reise.

Raw blocks

The blocks markdown, html and code take their indented body verbatim (multi-line) — ideal for prose.

markdown
  # Heading
  A **paragraph** across several lines.
markdown and html are sanitised before output (scripts, event handlers and javascript: links are removed).

Placeholders

Inside field values, {{ … }} accesses selected values; the output is always escaped.

PlaceholderValue
{{ site.title }}site title (from settings)
{{ site.description }}site description
{{ post.title }}current post title (single view)
{{ page.title }}current page title
{{ year }}current year