Closed chrishough closed 10 years ago
All Liquid commands should be handled like plain text (because it is processed after the Haml conversion.
So just don't indent after an (Liquid) if statement.
Consider the following example:
%ul
{% if 1=0 %}
%li= "Foo"
{% else %}
%li= "Bar"
{% endif %}
For your code I would write:
| {% if page.tags %}
%meta{name: "keywords", content: "{{ page.tags | join: ', ' }}"}
| {% endif %}
Also possible:
= "| {% if page.tags %}"
%meta{name: "keywords", content: "{{ page.tags | join: ', ' }}"}
= "| {% endif %}"
Thank you! :smile_cat:
Is it possible to work around the indentation? I really don't like the look of the not indented liquid-tags.
How would you use if statements?