1️⃣ Default Layout Injection
Given a layout like:
1doctype html2html3 head4 title My App5 body6 h1 Header from layout
The engine automatically injects:
- Live reload script (always)
- Default content block if
.page!= pageis missing - Default scripts block if
.scripts!= scriptsis missing
Rendered final Pug:
1doctype html2html3 head4 title My App5 body6 h1 Header from layout8 // ✅ Injected automatically:9 script.10 const es = new EventSource('/__reload');11 es.onmessage = (e) => {12 if (e.data === 'reload') location.reload();13 };15 if page16 .page!= page18 if scripts19 .scripts!= scripts
User-defined blocks are respected — duplicates are never injected.