Path: | README.md |
Last Update: | Wed Sep 26 19:49:49 +0000 2012 |
# Liquid template engine
## Introduction
Liquid is a template engine which was written with very specific requirements:
## Why you should use Liquid
## What does it look like?
```html <ul id="products">
{% for product in products %} <li> <h2>{{ product.name }}</h2> Only {{ product.price | price }} {{ product.description | prettyprint | paragraph }} </li> {% endfor %}
</ul> ```
## How to use Liquid
Liquid supports a very simple API based around the Liquid::Template class. For standard use you can just pass it the content of a file and call render with a parameters hash.
```ruby @template = Liquid::Template.parse("hi {{name}}") # Parses and compiles the template @template.render(‘name’ => ‘tobi’) # => "hi tobi" ```
[](http://travis-ci.org/Shopify/liquid)