YAML Pages and Sections

Build a page from top to bottom with plain YAML, then let Webifier render the same structure.

A Webifier site starts with a landing page. By convention that page is index.yml, because static websites already use index.html as the page people land on first.

The important idea is not the filename. The important idea is the graph: your site starts from one page, that page links to other content pages, and Webifier follows those links to render the reachable website.

A Webifier page is a YAML object. Ordinary top-level keys become sections in the order you write them. Those sections can contain Markdown, links, nested sections, notebooks, generated content, or custom objects handled by extensions.

The page syntax depends on the extensions you enable. The tutorials use webifier.standard, which gives the familiar webpage controls such as header, nav, meta, footer, and regular sections.

You can think of the source tree as content nodes:

  • index.yml describes the first page.
  • Markdown files, notebooks, HTML files, PDFs, and YAML sub-pages are linked from content.
  • Links such as md=pages/notes.md or index=pages/report.yml tell Webifier to render another page.
  • Extensions can teach Webifier what new content and page shapes mean.

So the workflow is close to ordinary writing: define what goes on the page, link to the next useful thing, and let the build walk the reachable content.

This YAML defines one section named introduction. The section label is shown on the side, and its content is rendered as Markdown.

introduction:
  label: Introduction
  content: |
    # A small project site

    This page can start as a note and grow into documentation.
    Add sections in the order you want people to read them.

A small project site

This page can start as a note and grow into documentation. Add sections in the order you want people to read them.

A page is just top-to-bottom content. The YAML key names are yours. They do not need to be from a fixed list unless a renderer or extension says otherwise.

question:
  label: Question
  content: |
    What changed in this experiment?

result:
  label: Result
  content: |
    The new preprocessing step reduced noisy examples.

next_steps:
  label: Next Steps
  content: |
    Try the same run on the larger dataset.

What changed in this experiment?

The new preprocessing step reduced noisy examples.

Try the same run on the larger dataset.

Sections can contain other sections. This lets you group related content without switching to a different file format.

project_notes:
  label: Project Notes
  summary:
    label: Summary
    content: |
      The project turns repository content into a static website.

  details:
    label: Details
    motivation:
      label: Motivation
      content: |
        Publishing should be close to writing and committing files.
    output:
      label: Output
      content: |
        The build produces static HTML, copied assets, and generated pages.

The project turns repository content into a static website.

Publishing should be close to writing and committing files.

The build produces static HTML, copied assets, and generated pages.

Most keys are content, but the standard page renderer reserves a few keys as page controls. They describe the surrounding webpage instead of becoming rendered sections.

title: My Project

header:
  title: My Project
  description: Notes, notebooks, and results from the project.

nav:
  brand:
    text: My Project
    link: /
  content:
    - text: Docs
      link: /pages/

meta:
  - name: description
    content: Project documentation and experiments.

config:
  webifier:
    extensions:
      site:
        uses: webifier.standard
      markdown:
        uses: webifier.markdown

introduction:
  label: Introduction
  content: This is content, because `introduction` is not reserved.

The default page renderer treats these page-level keys specially: kind, template, title, nav, header, footer, meta, config, search, and style.

Other extensions can also consume their own page keys. If an extension claims a key, that key is removed before ordinary section rendering. If no extension claims it, the standard renderer treats it as content.

Page shape:

title: Page title

header:
  title: Visible header title
  description: Optional header text

nav:
  ...

config:
  ...

section_key:
  label: Section Label
  content: |
    Markdown content

Page-level summary:

Key shape Meaning
index.yml The starting page.
title Browser/page title.
header, nav, footer, meta, style Standard page controls from webifier.standard.
config Site or page behavior; not visible content.
kind, template Renderer/template dispatch controls.
extension-consumed keys Custom keys claimed by enabled extensions before section rendering.
ordinary top-level keys Visible sections rendered in source order.

Content shape summary:

Value type Default behavior
string Render as Markdown.
list Render as a link list.
dictionary Render as a page at the root, or as a section below the root.
nested dictionary Render recursively unless kind chooses another renderer.

The next layer is section control: labels, label positions, hidden labels, templates, defaults, and renderer dispatch.