corrade-nucleus-nucleons – Blame information for rev 20
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
20 | office | 1 | The following examples can be found in full at http://liquidmarkup.org/ |
2 | |||
3 | Liquid is an extraction from the e-commerce system Shopify. |
||
4 | Shopify powers many thousands of e-commerce stores which all call for unique designs. |
||
5 | For this we developed Liquid which allows our customers complete design freedom while |
||
6 | maintaining the integrity of our servers. |
||
7 | |||
8 | Liquid has been in production use since June 2006 and is now used by many other |
||
9 | hosted web applications. |
||
10 | |||
11 | It was developed for usage in Ruby on Rails web applications and integrates seamlessly |
||
12 | as a plugin but it also works excellently as a stand alone library. |
||
13 | |||
14 | Here's what it looks like: |
||
15 | |||
16 | <ul id="products"> |
||
17 | {% for product in products %} |
||
18 | <li> |
||
19 | <h2>{{ product.title }}</h2> |
||
20 | Only {{ product.price | format_as_money }} |
||
21 | |||
22 | <p>{{ product.description | prettyprint | truncate: 200 }}</p> |
||
23 | |||
24 | </li> |
||
25 | {% endfor %} |
||
26 | </ul> |
||
27 | |||
28 | |||
29 | Some more features include: |
||
30 | |||
31 | <h2>Filters</h2> |
||
32 | <p> The word "tobi" in uppercase: {{ 'tobi' | upcase }} </p> |
||
33 | <p>The word "tobi" has {{ 'tobi' | size }} letters! </p> |
||
34 | <p>Change "Hello world" to "Hi world": {{ 'Hello world' | replace: 'Hello', 'Hi' }} </p> |
||
35 | <p>The date today is {{ 'now' | date: "%Y %b %d" }} </p> |
||
36 | |||
37 | |||
38 | <h2>If</h2> |
||
39 | <p> |
||
40 | {% if user.name == 'tobi' or user.name == 'marc' %} |
||
41 | hi marc or tobi |
||
42 | {% endif %} |
||
43 | </p> |
||
44 | |||
45 | |||
46 | <h2>Case</h2> |
||
47 | <p> |
||
48 | {% case template %} |
||
49 | {% when 'index' %} |
||
50 | Welcome |
||
51 | {% when 'product' %} |
||
52 | {{ product.vendor | link_to_vendor }} / {{ product.title }} |
||
53 | {% else %} |
||
54 | {{ page_title }} |
||
55 | {% endcase %} |
||
56 | </p> |
||
57 | |||
58 | |||
59 | <h2>For Loops</h2> |
||
60 | <p> |
||
61 | {% for item in array %} |
||
62 | {{ item }} |
||
63 | {% endfor %} |
||
64 | </p> |
||
65 | |||
66 | |||
67 | <h2>Tables</h2> |
||
68 | <p> |
||
69 | {% tablerow item in items cols: 3 %} |
||
70 | {% if tablerowloop.col_first %} |
||
71 | First column: {{ item.variable }} |
||
72 | {% else %} |
||
73 | Different column: {{ item.variable }} |
||
74 | {% endif %} |
||
75 | {% endtablerow %} |
||
76 | </p> |