How do I Liquid?

This commit is contained in:
Parker Moore
2015-03-13 16:20:30 -07:00
parent 57f83933fd
commit dc7cd7704f
3 changed files with 11 additions and 11 deletions

View File

@@ -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.

View File

@@ -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.

View File

@@ -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>