bim

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

  1. Layout matching collection name (e.g., blog.html for blog)
  2. Fallback to default.html
  3. Built-in default if no layouts exist

Placeholders

Layouts support these placeholders:

PlaceholderContent
{{title}}Page title
{{content}}Rendered HTML content
Navigation HTML
Backlinks section
2026-02-03Date string
enLanguage code (e.g., "en")
ltrText 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