mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-26 13:45:13 -07:00
Removed example because it doesn't render right here on the new wiki :/
Updated Home (textile)
-17
@@ -5,23 +5,6 @@ Liquid is a template engine which was crafted for very specific requirements
|
|||||||
* It has to be stateless. The compile and render steps have to be separate, so that the expensive parsing and compiling can be done once; later on, you can just render it by passing in a hash with local variables and objects.
|
* It has to be stateless. The compile and render steps have to be separate, so that the expensive parsing and compiling can be done once; later on, you can just render it by passing in a hash with local variables and objects.
|
||||||
* It needs to be able to style emails as well as HTML.
|
* It needs to be able to style emails as well as HTML.
|
||||||
|
|
||||||
h2. What does it look like?
|
|
||||||
|
|
||||||
source = %|
|
|
||||||
<ul id="products">
|
|
||||||
{% for product in products %}
|
|
||||||
<li>
|
|
||||||
<h2>{{product.name}}</h2>
|
|
||||||
Only {{product.price | price }}
|
|
||||||
|
|
||||||
{{product.description | textile }}
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>|
|
|
||||||
|
|
||||||
@template = Liquid::Template.parse(source)
|
|
||||||
@template.render( 'products' => Product.all )
|
|
||||||
|
|
||||||
|
|
||||||
h2. Stuff to read, watch, etc.
|
h2. Stuff to read, watch, etc.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user