A partial let you store a snippet of markup as a separate file, so you can reuse common code blocks in multiple layouts and templates.
To create and use a partial:
- Create a file in
/compartments/partials/
, such assubnav.html
- Add markup to the partial. The partial has access to any data and properties relative to the template or layout that it is inserted into.*
- Render a partial by adding the partial helper to the markup. Your partial name will match the partial filename. This example shows a reference to the partial called
subnav.html
.
// Partial: `subnav.html`