as Modifier

Alias an array variable as another name, allowing you to massage your data to reused shared components and templates.

type: text
content: I love to eat tacos in the bathroom.
type: photo
photo: /assets/img/baño-tacos.jpg
{{ blocks as="sets" }}
{{ sets }}
{{ partial:type }}
{{ /sets }}
{{ /blocks }}
<!-- Each block would be rendered with its own partial matching the {{ type }} var -->
<div class="text">
<p>I like to eat tacos in the bathroom.</p>
<div class="photo">
<img src="/assets/img/baño-tacos.jpg">
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →