Pages & layout
Three real pages, one shared header and footer, and the PHPDOC block that drives them.
-
Add two more pages
Studio Plié needs a home page (already there), a notes section, and a gallery:
src/ ├── _index.php → / ├── notes/_index.php → /notes/ └── atelier/_index.php → /atelier/Each starts the same way — a PHPDOC block, then markup:
/** * @title Atelier * @section atelier * @abstract Where the folding happens. */ echo '<h1>' . str_htmlesc($title) . '</h1>'; echo '<p>' . str_htmlesc($abstract) . '</p>';Every
@key valuein that docblock becomes a$keyvariable — in the page itself, and inbefore/after. Define whatever keys make sense;@title,@sectionand@abstractare just this project's own convention, not reserved words. -
Wire up navigation in the header
src/_layouts/header.phpruns before every page (it'sprepros.beforeinkirigami.yaml), so it's the natural place for a nav built from a plain PHP array:$nav = [ '' => ['Home', 'home'], 'notes/' => ['Notes', 'notes'], 'atelier/' => ['Atelier','atelier'], ];foreach ($nav as $path => [$label, $key]) { $current = ($section ?: 'home') === $key; echo '<a href="' . $relroot . $path . '"' . ($current ? ' aria-current="page"' : '') . '>' . $label . '</a>'; }$relrootis injected by Kirigami on every render — the relative path from the current page back tokirigami.root— so these links work whether the current page is/or three folders deep. -
Close the layout in the footer
src/_layouts/footer.phpisprepros.after— it closes whatever<main>/<body>the header opened. Nothing new here yet; it stays as the starter template left it until Part 4 re-themes it.
NOTE
There's no router, no template inheritance system, no special "layout" concept beyond two plain PHP includes run before and after the page body. That's deliberate — it's the same PHP you already know, just running once at build time instead of on every request.