Liquid Markup Tutorial

Liquid Markup is a way to build safe web page templates which protect the security of the web server.


What does it look like?

  My name is {{ }}

Liquid Markup has loops:

  {% for user in users %}
     My name is {{ }}
  {% endfor %}

Liquid Markup has if/then/else conditionals:

  {% if == 'Alice' %}
     This is text is just for Alice.
  {% else %}
     This is text is for everyone else.
  {% endif %}

Liquid Markup can use any HTML tags:

  My web page is %gt;a href="{{ user.url }}"%lt;here

Liquid Markup has filters for common needs:

  My lunch costs {{lunch.price | format_as_money }}

What's Next?

blog comments powered by Disqus