Layouts
Layouts are HTML templates with placeholder substitution.
Layout Directory
Place layouts in layouts/:
layouts/
default.html # Fallback for all pages
blog.html # Blog-specific layout
notes.html # Notes-specific layout
snippets.html # Snippets-specific layout
Layout Selection
- Layout matching collection name (e.g.,
blog.htmlfor blog) - Fallback to
default.html - Built-in default if no layouts exist
Placeholders
Layouts support these placeholders:
| Placeholder | Content |
|---|---|
{{title}} | Page title |
{{content}} | Rendered HTML content |
| Navigation HTML |
| Backlinks section |
2026-02-03 | Date string |
en | Language code (e.g., "en") |
ltr | Text direction ("ltr" or "rtl") |
Example Layout
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<title>{{title}}</title>
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<main>
{{content}}
</main>
<footer>
Last modified: 2026-02-03
</footer>
</body>
</html>
No Template Logic
Layouts are not templates with logic. No conditionals, loops, or includes. This is intentional—keep logic in Rust, keep layouts simple.
Related: #layouts #templates #html @documentation