Getting Started¶
Project layout¶
A typical project that uses Template::HAML keeps its templates under an app/views/ (or any other) directory, organized by controller / feature, with the .html.haml extension:
1 2 3 4 5 6 7 8 9 | |
Your first template¶
Create hello.haml:
1 2 3 4 | |
Render it from Raku:
1 2 3 4 | |
You should see:
1 2 3 4 5 6 | |
Rendering from a string¶
HAML.render takes any string, so you can also embed templates inline:
1 2 3 4 5 6 7 | |
Where to go next¶
- Tags — element names, sigils, class and id shorthand
- Attributes — hash-style attribute syntax
- Indentation — how nesting works
- API — the public Raku API