mirror of
https://github.com/kemko/liquid.git
synced 2026-01-05 01:35:41 +03:00
How do I Liquid?
This commit is contained in:
@@ -4,9 +4,9 @@ title: capitalize
|
||||
|
||||
`capitalize` ensures the first character of your string is capitalized.
|
||||
|
||||
| Input | Output |
|
||||
|------------------------------------:|:-----------------|
|
||||
| `{ "title" | capitalize }` | "Title" |
|
||||
| `{ "my great title" | capitalize }` | "My great title" |
|
||||
| Input | Output |
|
||||
|--------------------------------------:|:-----------------|
|
||||
| `{{ "title" | capitalize }}` | "Title" |
|
||||
| `{{ "my great title" | capitalize }}` | "My great title" |
|
||||
|
||||
It only capitalizes the first character, so subsequent words will not be capitalized as well.
|
||||
|
||||
@@ -4,11 +4,11 @@ title: ceil
|
||||
|
||||
`ceil` rounds the input up to the nearest whole number.
|
||||
|
||||
| Input | Output |
|
||||
|--------------------:|:-------|
|
||||
| `{ 1.2 | ceil }` | 2 |
|
||||
| `{ 1.7 | ceil }` | 2 |
|
||||
| `{ 2.0 | ceil }` | 2 |
|
||||
| `{ "18.3" | ceil }` | 19 |
|
||||
| Input | Output |
|
||||
|----------------------:|:-------|
|
||||
| `{{ 1.2 | ceil }}` | 2 |
|
||||
| `{{ 1.7 | ceil }}` | 2 |
|
||||
| `{{ 2.0 | ceil }}` | 2 |
|
||||
| `{{ "18.3" | ceil }}` | 19 |
|
||||
|
||||
It will attempt to cast any input to a number.
|
||||
@@ -9,7 +9,7 @@
|
||||
<nav class="sidebar--nav">
|
||||
<ul>
|
||||
{% for collection in site.collections %}
|
||||
<li>{{ collection[0] | capitalize }}
|
||||
<li><a href="{{ collection[0] | prepend: "/" | prepend: site.baseurl | append: "/" }}">{{ collection[0] | capitalize }}</a>
|
||||
<ul>
|
||||
{% for doc in collection[1].docs %}
|
||||
<li><a href="{{ "/filters/" | append: "#" | append: doc.title | prepend: site.baseurl }}">{{ doc.title }}</a></li>
|
||||
|
||||
Reference in New Issue
Block a user