Statico Source
Contents

Layouts

Wrap pages in shared shells, pass them attributes, and nest layouts.

Building pages, page 5

A page picks a layout and passes attributes:

<layout src="main.html" title="About us">
    <h1>About</h1>
</layout>

layouts/main.html receives the page body in {slot} and each attribute as {name}:

<!DOCTYPE html>
<html lang="en">
<head>
    <title>{title}</title>
    {seo}
    {tailwindcss}
</head>
<body>{slot}</body>
</html>

A layout may itself start with <layout src="base.html"> (nested layouts).