Layouts & Templates
Layouts & Templates
The UI bundle uses Handlebars as its template engine. Two layouts define page structure, 27 partials compose reusable UI components, and 9 helpers provide conditional logic.
Layouts
| File | Lines | Purpose |
|---|---|---|
|
11 |
Main page layout: assembles head, header, body, footer |
|
11 |
Error page with custom styling and nav link |
Partial Composition Tree
default.hbs orchestrates all partials in this hierarchy:
default.hbs
├── head.hbs
│ ├── head-prelude.hbs DOCTYPE + lang
│ ├── head-title.hbs <title> tag
│ ├── head-icons.hbs Favicons
│ ├── head-meta.hbs Meta tags (charset, viewport, description)
│ ├── head-scripts.hbs Preload scripts
│ ├── head-styles.hbs FOUC prevention script + CSS link
│ └── head-info.hbs Author, canonical, component meta
├── header.hbs
│ ├── header-content.hbs Enterprise navbar (5 dropdown menus)
│ └── header-scripts.hbs Mobile navbar JS
├── body.hbs
│ ├── nav.hbs
│ │ ├── nav-toggle.hbs Sidebar toggle button
│ │ └── nav-menu.hbs
│ │ └── nav-tree.hbs Recursive tree rendering
│ ├── nav-explore.hbs Component explorer panel
│ ├── main.hbs
│ │ ├── toolbar.hbs Version/edit controls
│ │ ├── breadcrumbs.hbs Breadcrumb trail
│ │ ├── article.hbs Article content wrapper
│ │ ├── toc.hbs Table of contents sidebar
│ │ └── pagination.hbs Prev/next page links
│ └── edit-this-page.hbs GitHub edit link
└── footer.hbs
├── footer-content.hbs Copyright + site info
└── footer-scripts.hbs Loads domus-ui.js + highlight.js
Partial Inventory
| Partial | Lines | Purpose |
|---|---|---|
|
115 |
Enterprise navbar with Components, Runbooks, Tools, Linux, GitHub dropdowns |
|
26 |
Component explorer — lists all site components with version badges |
|
21 |
Recursive Handlebars |
|
20 |
Script preloading |
|
20 |
Author, canonical URL, component metadata |
|
20 |
Breadcrumb trail generation with |
|
16 |
Previous/next page navigation links |
|
12 |
Version selector dropdown |
|
12 |
FOUC prevention inline script + CSS stylesheet link |
|
11 |
Sidebar menu wrapper (includes nav-tree) |
|
11 |
Page body: toolbar + breadcrumbs + article + toc + pagination |
|
10 |
404 error page content |
|
9 |
Page toolbar (version selector, edit link) |
|
8 |
Sidebar container (toggle + menu) |
|
7 |
Assembles all head-* partials |
|
7 |
Article content wrapper |
|
6 |
Loads site.js, domus-ui.js, highlight.js (async), search scripts |
|
5 |
GitHub edit link (conditional on |
|
4 |
Copyright line with |
|
4 |
Body wrapper (nav + main + footer) |
|
3 |
Right sidebar table of contents |
|
2 |
DOCTYPE declaration + html lang |
|
2 |
Header wrapper |
|
2 |
Footer wrapper |
|
1 |
Sidebar toggle button |
|
1 |
Document title tag |
|
1 |
Charset + viewport + description meta tags |
|
1 |
Favicon links |
|
1 |
Header-level script loading |
Handlebars Helpers
| Helper | Lines | Purpose |
|---|---|---|
|
24 |
Convert absolute paths to relative (used for asset URLs) |
|
9 |
Logical AND for conditional blocks |
|
9 |
Logical OR for conditional blocks |
|
7 |
Strip HTML tags from strings |
|
3 |
Equality comparison |
|
3 |
Not-equal comparison |
|
3 |
Logical NOT |
|
3 |
Increment a number by 1 (used in nav tree depth) |
|
3 |
Return current year (used in footer copyright) |
Data Context
Key variables available in all templates:
| Variable | Description |
|---|---|
|
Site title from playbook (e.g., "Domus Digitalis") |
|
Site base URL |
|
Site-wide custom keys |
|
Current page title |
|
Current component object (name, title, versions) |
|
Navigation tree for current component |
|
GitHub edit URL (if configured) |
|
Relative path to UI assets ( |
|
Relative path to site root |
|
Search provider (e.g., "lunr") |