From 9ff1b889851a42712e33f2ad1db11054c9857e57 Mon Sep 17 00:00:00 2001 From: EricFromCanada Date: Wed, 4 Sep 2019 13:31:26 -0400 Subject: [PATCH] Adjust whitespace --- _basics/introduction.md | 2 -- _filters/compact.md | 1 - _filters/prepend.md | 2 -- _filters/where.md | 13 ++++--------- _tags/iteration.md | 10 +++++----- _tags/variable.md | 3 ++- 6 files changed, 11 insertions(+), 20 deletions(-) diff --git a/_basics/introduction.md b/_basics/introduction.md index 8045fecd..167a685c 100644 --- a/_basics/introduction.md +++ b/_basics/introduction.md @@ -10,7 +10,6 @@ Liquid code can be categorized into [**objects**](#objects), [**tags**](#tags), **Objects** tell Liquid where to show content on a page. Objects and variable names are denoted by double curly braces: `{% raw %}{{{% endraw %}` and `{% raw %}}}{% endraw %}`. -

Input

```liquid {% raw %} @@ -53,7 +52,6 @@ Tags can be categorized into three types: You can read more about each type of tag in their respective sections. - ## Filters **Filters** change the output of a Liquid object. They are used within an output and are separated by a `|`. diff --git a/_filters/compact.md b/_filters/compact.md index 4b7648b6..2c6f22ba 100644 --- a/_filters/compact.md +++ b/_filters/compact.md @@ -7,7 +7,6 @@ Removes any `nil` values from an array. For this example, assume `site.pages` is an array of content pages for a website, and some of these pages have an attribute called `category` that specifies their content category. If we `map` those categories to an array, some of the array items might be `nil` if any pages do not have a `category` attribute. -

Input

{% raw %} ```liquid diff --git a/_filters/prepend.md b/_filters/prepend.md index 04094273..c5d32e5c 100644 --- a/_filters/prepend.md +++ b/_filters/prepend.md @@ -23,7 +23,6 @@ You can also `prepend` variables: ```liquid {% raw %} {% assign url = "example.com" %} - {{ "/index.html" | prepend: url }} {% endraw %} ``` @@ -31,6 +30,5 @@ You can also `prepend` variables:

Output

```text {% assign url = "example.com" %} - {{ "/index.html" | prepend: url }} ``` diff --git a/_filters/where.md b/_filters/where.md index 178f8293..9d8becdf 100644 --- a/_filters/where.md +++ b/_filters/where.md @@ -13,14 +13,14 @@ In this example, assume you have a list of products and you want to show your ki All products: {% for product in products %} - {{ product.title }} -{% endfor %} +{% endfor %} {% assign kitchen_products = products | where: "type", "kitchen" %} Kitchen products: {% for product in kitchen_products %} - {{ product.title }} -{% endfor %} +{% endfor %} ``` {% endraw %} @@ -35,7 +35,6 @@ All products: Kitchen products: - Spatula - Garlic press - ``` Say instead you have a list of products and you only want to show those that are available to buy. You can `where` with a property name but no target value to include all products with a [truthy]({{ "/basics/truthy-and-falsy#truthy" | prepend: site.baseurl }}) `"available"` value. @@ -44,22 +43,20 @@ Say instead you have a list of products and you only want to show those that are {% raw %} ```liquid All products: -{% for product in products %} +{% for product in products %} - {{ product.title }} {% endfor %} {% assign available_products = products | where: "available" %} Available products: -{% for product in available_products %} +{% for product in available_products %} - {{ product.title }} {% endfor %} - ``` {% endraw %}

Output

- ```text All products: - Coffee mug @@ -69,10 +66,8 @@ All products: Available products: - Coffee mug - Boring sneakers - ``` - The `where` filter can also be used to find a single object in an array when combined with the `first` filter. For example, say you want to show off the shirt in your new fall collection.

Input

diff --git a/_tags/iteration.md b/_tags/iteration.md index 07d6e244..f87da419 100644 --- a/_tags/iteration.md +++ b/_tags/iteration.md @@ -12,9 +12,9 @@ Repeatedly executes a block of code. For a full list of attributes available wit

Input

```liquid {% raw %} - {% for product in collection.products %} - {{ product.title }} - {% endfor %} +{% for product in collection.products %} + {{ product.title }} +{% endfor %} {% endraw %} ``` @@ -196,8 +196,8 @@ one Uses for `cycle` include: -- applying odd/even classes to rows in a table -- applying a unique class to the last product thumbnail in a row +- applying odd/even classes to rows in a table +- applying a unique class to the last product thumbnail in a row ## cycle (parameters) diff --git a/_tags/variable.md b/_tags/variable.md index 4b0996a9..6bc26a74 100644 --- a/_tags/variable.md +++ b/_tags/variable.md @@ -21,7 +21,7 @@ Creates a new variable.

Output

```text - This statement is valid. +This statement is valid. ``` Wrap a variable in quotations `"` to save it as a string. @@ -55,6 +55,7 @@ Captures the string inside of the opening and closing tags and assigns it to a v ```text I am being captured. ``` + Using `capture`, you can create complex strings using other variables created with `assign`.

Input