Adjust whitespace

This commit is contained in:
EricFromCanada
2019-09-09 22:58:29 -04:00
parent 4cfd19a27e
commit 9ff1b88985
6 changed files with 11 additions and 20 deletions
-2
View File
@@ -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 %}`. **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 %}`.
<p class="code-label">Input</p> <p class="code-label">Input</p>
```liquid ```liquid
{% raw %} {% 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. You can read more about each type of tag in their respective sections.
## Filters ## Filters
**Filters** change the output of a Liquid object. They are used within an output and are separated by a `|`. **Filters** change the output of a Liquid object. They are used within an output and are separated by a `|`.
-1
View File
@@ -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. 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.
<p class="code-label">Input</p> <p class="code-label">Input</p>
{% raw %} {% raw %}
```liquid ```liquid
-2
View File
@@ -23,7 +23,6 @@ You can also `prepend` variables:
```liquid ```liquid
{% raw %} {% raw %}
{% assign url = "example.com" %} {% assign url = "example.com" %}
{{ "/index.html" | prepend: url }} {{ "/index.html" | prepend: url }}
{% endraw %} {% endraw %}
``` ```
@@ -31,6 +30,5 @@ You can also `prepend` variables:
<p class="code-label">Output</p> <p class="code-label">Output</p>
```text ```text
{% assign url = "example.com" %} {% assign url = "example.com" %}
{{ "/index.html" | prepend: url }} {{ "/index.html" | prepend: url }}
``` ```
-5
View File
@@ -35,7 +35,6 @@ All products:
Kitchen products: Kitchen products:
- Spatula - Spatula
- Garlic press - 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. 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.
@@ -54,12 +53,10 @@ Available products:
{% for product in available_products %} {% for product in available_products %}
- {{ product.title }} - {{ product.title }}
{% endfor %} {% endfor %}
``` ```
{% endraw %} {% endraw %}
<p class="code-label">Output</p> <p class="code-label">Output</p>
```text ```text
All products: All products:
- Coffee mug - Coffee mug
@@ -69,10 +66,8 @@ All products:
Available products: Available products:
- Coffee mug - Coffee mug
- Boring sneakers - 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. 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.
<p class="code-label">Input</p> <p class="code-label">Input</p>
+5 -5
View File
@@ -12,9 +12,9 @@ Repeatedly executes a block of code. For a full list of attributes available wit
<p class="code-label">Input</p> <p class="code-label">Input</p>
```liquid ```liquid
{% raw %} {% raw %}
{% for product in collection.products %} {% for product in collection.products %}
{{ product.title }} {{ product.title }}
{% endfor %} {% endfor %}
{% endraw %} {% endraw %}
``` ```
@@ -196,8 +196,8 @@ one
Uses for `cycle` include: Uses for `cycle` include:
- applying odd/even classes to rows in a table - applying odd/even classes to rows in a table
- applying a unique class to the last product thumbnail in a row - applying a unique class to the last product thumbnail in a row
## cycle (parameters) ## cycle (parameters)
+2 -1
View File
@@ -21,7 +21,7 @@ Creates a new variable.
<p class="code-label">Output</p> <p class="code-label">Output</p>
```text ```text
This statement is valid. This statement is valid.
``` ```
Wrap a variable in quotations `"` to save it as a string. 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 ```text
I am being captured. I am being captured.
``` ```
Using `capture`, you can create complex strings using other variables created with `assign`. Using `capture`, you can create complex strings using other variables created with `assign`.
<p class="code-label">Input</p> <p class="code-label">Input</p>