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
+4 -4
View File
@@ -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" | | `{{ "title" | capitalize }}` | "Title" |
| `{ "my great title" | capitalize }` | "My great title" | | `{{ "my great title" | capitalize }}` | "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
View File
@@ -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 | | `{{ 1.2 | ceil }}` | 2 |
| `{ 1.7 | ceil }` | 2 | | `{{ 1.7 | ceil }}` | 2 |
| `{ 2.0 | ceil }` | 2 | | `{{ 2.0 | ceil }}` | 2 |
| `{ "18.3" | ceil }` | 19 | | `{{ "18.3" | ceil }}` | 19 |
It will attempt to cast any input to a number. It will attempt to cast any input to a number.
+1 -1
View File
@@ -9,7 +9,7 @@
<nav class="sidebar--nav"> <nav class="sidebar--nav">
<ul> <ul>
{% for collection in site.collections %} {% for collection in site.collections %}
<li>{{ collection[0] | capitalize }} <li><a href="{{ collection[0] | prepend: "/" | prepend: site.baseurl | append: "/" }}">{{ collection[0] | capitalize }}</a>
<ul> <ul>
{% for doc in collection[1].docs %} {% for doc in collection[1].docs %}
<li><a href="{{ "/filters/" | append: "#" | append: doc.title | prepend: site.baseurl }}">{{ doc.title }}</a></li> <li><a href="{{ "/filters/" | append: "#" | append: doc.title | prepend: site.baseurl }}">{{ doc.title }}</a></li>