Merge pull request #1 from parkr/updates-to-doc-update

Continue updating documentation
This commit is contained in:
Parker Moore
2015-03-18 13:39:05 -07:00
8 changed files with 64 additions and 0 deletions
+9
View File
@@ -1,3 +1,12 @@
---
title: date
---
`date` converts a timestamp into another date format.
| Input | Output |
|--------------------------------------------------------------------------:|:---------------------|
| {% raw %}`{{ article.published_at | date: "%a, %b %d, %y" }}`{% endraw %} | Tue, Apr 22, 14 |
| {% raw %}`{{ article.published_at | date: "%Y" }}`{% endraw %} | 2014 |
The format for this syntax is the same as [`strftime`](http://strftime.net/).
+9
View File
@@ -1,3 +1,12 @@
---
title: escape
---
Escapes a string by replacing characters with escape sequences (so that the string can be used in a URI).
| Code | Output |
|-------------------------------------------------------:|:-------------------|
| {% raw %}`{{ "Need tips? Ask a friend!" | escape }}`{% endraw %} | `"Need%20tips%3F%Ask%20a%20friend%21"` |
| {% raw %}`{{ "Nope" | escape }}`{% endraw %} | `"Nope"` |
It doesn't modify strings that have nothing to escape.
+10
View File
@@ -1,3 +1,13 @@
---
title: escape_once
---
Escapes a string without affecting existing escaped entities.
| Code | Output |
|-------------------------------------------------------:|:-------------------|
| {% raw %}`{{ "1 < 2 & 3" | escape_once }}`{% endraw %} | `"1 < 2 & 3"` |
| {% raw %}`{{ "<< Accept & Checkout" | escape_once }}`{% endraw %} | `"<< Accept & Checkout"` |
| {% raw %}`{{ "Nope" | escape_once }}`{% endraw %} | `"Nope"` |
It doesn't modify strings that have nothing to escape.
+8
View File
@@ -1,3 +1,11 @@
---
title: first
---
Return the first element of an array.
| Code | Output |
|-------------------------------------------------------:|:-------------------|
| {% raw %}`{{ product.tags | first }}`{% endraw %} | `"sale"` |
In the sample above, assume that `product.tags` resolves to: `["sale", "mens", "womens", "awesome"]`.
+11
View File
@@ -1,3 +1,14 @@
---
title: floor
---
`floor` rounds the input down to the nearest whole number.
| Input | Output |
|-------------------------------------------:|:-------|
| {% raw %}`{{ 1.2 | floor }}` {% endraw %} | 1 |
| {% raw %}`{{ 1.7 | floor }}` {% endraw %} | 1 |
| {% raw %}`{{ 2.0 | floor }}` {% endraw %} | 2 |
| {% raw %}`{{ "18.3" | floor }}`{% endraw %} | 18 |
It will attempt to cast any input to a number.
+8
View File
@@ -1,3 +1,11 @@
---
title: join
---
`join` joins the elements of an array, using the character you provide.
| Code | Output |
|-------------------------------------------------------:|:-------------------|
| {% raw %}`{{ product.tags | join: ', ' }}`{% endraw %} | `"sale, mens, womens, awesome` |
In the sample above, assume that `product.tags` resolves to: `["sale", "mens", "womens", "awesome"]`.
+8
View File
@@ -1,3 +1,11 @@
---
title: last
---
Return the last element of an array.
| Code | Output |
|-------------------------------------------------------:|:-------------------|
| {% raw %}`{{ product.tags | last }}`{% endraw %} | `"awesome"` |
In the sample above, assume that `product.tags` resolves to: `["sale", "mens", "womens", "awesome"]`.
+1
View File
@@ -85,6 +85,7 @@ $on-laptop: 900px;
width: $sidebar-width;
height: 100vh;
position: fixed;
overflow: scroll;
}
.sidebar--logo {