The following examples can be found in full at http://liquidmarkup.org/ Liquid is an extraction from the e-commerce system Shopify. Shopify powers many thousands of e-commerce stores which all call for unique designs. For this we developed Liquid which allows our customers complete design freedom while maintaining the integrity of our servers. Liquid has been in production use since June 2006 and is now used by many other hosted web applications. It was developed for usage in Ruby on Rails web applications and integrates seamlessly as a plugin but it also works excellently as a stand alone library. Here's what it looks like: Some more features include:

Filters

The word "tobi" in uppercase: {{ 'tobi' | upcase }}

The word "tobi" has {{ 'tobi' | size }} letters!

Change "Hello world" to "Hi world": {{ 'Hello world' | replace: 'Hello', 'Hi' }}

The date today is {{ 'now' | date: "%Y %b %d" }}

If

{% if user.name == 'tobi' or user.name == 'marc' %} hi marc or tobi {% endif %}

Case

{% case template %} {% when 'index' %} Welcome {% when 'product' %} {{ product.vendor | link_to_vendor }} / {{ product.title }} {% else %} {{ page_title }} {% endcase %}

For Loops

{% for item in array %} {{ item }} {% endfor %}

Tables

{% tablerow item in items cols: 3 %} {% if tablerowloop.col_first %} First column: {{ item.variable }} {% else %} Different column: {{ item.variable }} {% endif %} {% endtablerow %}