diff --git a/_filters/date.md b/_filters/date.md index 1c281473..627368aa 100644 --- a/_filters/date.md +++ b/_filters/date.md @@ -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/). diff --git a/_filters/escape.md b/_filters/escape.md index fc6ec992..800651bd 100644 --- a/_filters/escape.md +++ b/_filters/escape.md @@ -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. diff --git a/_filters/escape_once.md b/_filters/escape_once.md index 8b243299..0ae33be5 100644 --- a/_filters/escape_once.md +++ b/_filters/escape_once.md @@ -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. diff --git a/_filters/first.md b/_filters/first.md index 8dc4da66..825949ce 100644 --- a/_filters/first.md +++ b/_filters/first.md @@ -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"]`. diff --git a/_filters/floor.md b/_filters/floor.md index 2f03820a..7d2aefa5 100644 --- a/_filters/floor.md +++ b/_filters/floor.md @@ -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. diff --git a/_filters/join.md b/_filters/join.md index 2de563e9..c74c1b90 100644 --- a/_filters/join.md +++ b/_filters/join.md @@ -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"]`. diff --git a/_filters/last.md b/_filters/last.md index 28ab8462..1a311b0b 100644 --- a/_filters/last.md +++ b/_filters/last.md @@ -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"]`. diff --git a/css/main.scss b/css/main.scss index bd0769a1..41b2ddda 100755 --- a/css/main.scss +++ b/css/main.scss @@ -85,6 +85,7 @@ $on-laptop: 900px; width: $sidebar-width; height: 100vh; position: fixed; + overflow: scroll; } .sidebar--logo {