mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Document divided_by & make liquid raw
This commit is contained in:
@@ -4,9 +4,9 @@ title: capitalize
|
|||||||
|
|
||||||
`capitalize` ensures the first character of your string is capitalized.
|
`capitalize` ensures the first character of your string is capitalized.
|
||||||
|
|
||||||
| Input | Output |
|
| Input | Output |
|
||||||
|--------------------------------------:|:-----------------|
|
|-----------------------------------------------------------:|:-----------------|
|
||||||
| `{{ "title" | capitalize }}` | "Title" |
|
| {% raw %}`{{ "title" | capitalize }}` {% endraw %} | "Title" |
|
||||||
| `{{ "my great title" | capitalize }}` | "My great title" |
|
| {% raw %}`{{ "my great title" | capitalize }}`{% endraw %} | "My great title" |
|
||||||
|
|
||||||
It only capitalizes the first character, so subsequent words will not be capitalized as well.
|
It only capitalizes the first character, so subsequent words will not be capitalized as well.
|
||||||
|
|||||||
+6
-6
@@ -4,11 +4,11 @@ title: ceil
|
|||||||
|
|
||||||
`ceil` rounds the input up to the nearest whole number.
|
`ceil` rounds the input up to the nearest whole number.
|
||||||
|
|
||||||
| Input | Output |
|
| Input | Output |
|
||||||
|----------------------:|:-------|
|
|-------------------------------------------:|:-------|
|
||||||
| `{{ 1.2 | ceil }}` | 2 |
|
| {% raw %}`{{ 1.2 | ceil }}` {% endraw %} | 2 |
|
||||||
| `{{ 1.7 | ceil }}` | 2 |
|
| {% raw %}`{{ 1.7 | ceil }}` {% endraw %} | 2 |
|
||||||
| `{{ 2.0 | ceil }}` | 2 |
|
| {% raw %}`{{ 2.0 | ceil }}` {% endraw %} | 2 |
|
||||||
| `{{ "18.3" | ceil }}` | 19 |
|
| {% raw %}`{{ "18.3" | ceil }}`{% endraw %} | 19 |
|
||||||
|
|
||||||
It will attempt to cast any input to a number.
|
It will attempt to cast any input to a number.
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
title: divided_by
|
||||||
|
---
|
||||||
|
|
||||||
|
This filter divides its input by its parameter.
|
||||||
|
|
||||||
|
| Code | Output |
|
||||||
|
|--------------------------------------------------:|:-------|
|
||||||
|
| {% raw %}`{{ 4 | divided_by: 2 }}` {% endraw %} | 2 |
|
||||||
|
| {% raw %}`{{ "16" | divided_by: 4 }}`{% endraw %} | 4 |
|
||||||
|
|
||||||
|
It uses `to_number`, which converts to a decimal value unless already a numeric.
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<li><a href="#">Nav Item 2</a></li>
|
<li><a href="https://github.com/Shopify/liquid">Source on GitHub</a></li>
|
||||||
<li><a href="#">Nav Item 3</a></li>
|
<li><a href="#">Nav Item 3</a></li>
|
||||||
<li><a href="#">Nav Item 4</a></li>
|
<li><a href="#">Nav Item 4</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user