Last active
March 3, 2021 22:18
-
-
Save greggnakamura/1177d9c0d0ed517b071aa4a5302087a5 to your computer and use it in GitHub Desktop.
Nunjucks: Random code samples
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
{# render component #} | |
{% render '@carousel' %} | |
{# render component with arguments #} | |
{% render '@hyperlink', { | |
url: '/path/to/page', | |
link_text: 'Learn more', | |
aria_label: 'Learn more about this item', | |
target: '_blank', | |
aria_describedby: 'new-window' } | |
%} | |
{# -------------------- #} | |
{# if #} | |
{% if variable %} | |
... | |
{% elif tired %} | |
... | |
{% else %} | |
... | |
{% endif %} | |
{# -------------------- #} | |
{# for #} | |
{% for slide in slides %} | |
... | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment