Last active
April 26, 2016 14:28
-
-
Save aerykk/ada567e1e92e6ca7d574bb4dd3212d06 to your computer and use it in GitHub Desktop.
Dust.js component usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Expose keys of the `accordion` object to the scope --> | |
{#accordion} | |
<div class="accordion-wrapper"> | |
<!-- Output a component called `accordion` and pass it `items` + `class` --> | |
{@c-accordion items=items class="padding-top-small"} | |
<!-- Override the `footer` block --> | |
{:footer} | |
<!-- Iterate the `links` array and expose keys of each object --> | |
{#links} | |
<!-- Output a component called `link` and pass it a `class` --> | |
{@c-link class="padding-all-bottom"} | |
<!-- Use exposed variables `href`, `src` and `alt` --> | |
<a href="{href}"> | |
<img src="{src}" alt="{alt}" /> | |
</a> | |
{/c-link} | |
{/links} | |
{/c-accordion} | |
</div | |
{/accordion} | |
<!-- Check if this scope has a `banners` key --> | |
{?banners} | |
<div class="padding-bottom-small margin-top-small"> | |
<!-- Iterate the `banners` array and expose each object's keys to the scope --> | |
{#banners} | |
<!-- Output a component called `banner` passing it the keys exposed to the scope --> | |
{@c-banner text=text image=image class="margin-bottom-md" /} | |
{/banners} | |
</div> | |
{/banners} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment