A few copy-edits

This commit is contained in:
Adam Hollett
2016-03-15 19:36:29 -04:00
committed by Tetsuro
parent 7b50ceb955
commit 74f478679f
21 changed files with 128 additions and 93 deletions
+4 -4
View File
@@ -2,7 +2,7 @@
title: Introduction
---
Liquid code can be categorized into three parts: **objects**, **tags**, and **filters**.
Liquid code can be categorized into [**objects**](#objects), [**tags**](#tags), and [**filters**](#filters).
## Objects
@@ -23,9 +23,9 @@ In this case, Liquid is rendering the content of an object called `page.title`,
## Tags
**Tags** create the logic and control flow for your templates. They are denoted by curly braces and percent signs: `{% raw %}{%{% endraw %}` and `{% raw %}%}{% endraw %}`.
**Tags** create the logic and control flow for templates. They are denoted by curly braces and percent signs: `{% raw %}{%{% endraw %}` and `{% raw %}%}{% endraw %}`.
Tag markup does not resolve to text. This means that you can assign variables and create conditionals and loops without showing any of the Liquid logic on the page.
The markup used in tags does not produce any visible text. This means that you can assign variables and create conditions and loops without showing any of the Liquid logic on the page.
```liquid
{% raw %}
@@ -51,7 +51,7 @@ You can read more about each type of tag in their respective sections.
## Filters
**Filters** modify the output of a Liquid object. They are using within an output and are separated by a `|`.
**Filters** change the output of a Liquid object. They are using within an output and are separated by a `|`.
```liquid
{% raw %}
+1 -1
View File
@@ -4,7 +4,7 @@ title: Operators
Liquid includes many logical and comparison operators.
## Basic Operators
## Basic operators
<table>
<tbody>
+4 -4
View File
@@ -12,11 +12,11 @@ In programming, anything that returns `true` in a conditional is called **truthy
All values in Liquid are truthy except `nil` and `false`.
In the example below, the text "Tobi" is not a boolean, but it is truthy in a conditional:
In the example below, the string "Tobi" is not a boolean, but it is truthy in a conditional:
```liquid
{% raw %}
{% assign tobi = 'Tobi' %}
{% assign tobi = "Tobi" %}
{% if tobi == true %}
This condition will always be true.
@@ -38,7 +38,7 @@ In the example below, the text "Tobi" is not a boolean, but it is truthy in a co
<h1></h1>
```
[EmptyDrops](/basics/types/#emptydrop) are also truthy. In the example below, if `settings.page` is an empty string or set to a hidden or deleted object, you will end up with an EmptyDrop. The result is an empty div:
[EmptyDrops](/basics/types/#emptydrop) are also truthy. In the example below, if `settings.page` is an empty string or set to a hidden or deleted object, you will end up with an EmptyDrop. The result is an empty `div`:
```liquid
{% raw %}
@@ -54,7 +54,7 @@ In the example below, the text "Tobi" is not a boolean, but it is truthy in a co
## Falsy
The falsy values in Liquid are [nil](/basics/types/#nil) and [false](/basics/types/#boolean).
The falsy values in Liquid are [`nil`](/basics/types/#nil) and [`false`](/basics/types/#boolean).
## Summary
+11 -11
View File
@@ -11,11 +11,11 @@ Liquid objects can have one of six types:
- [Array](#array)
- [EmptyDrop](#emptydrop)
Liquid variables can be initialized by using the [assign](/tags/#assign) or [capture](/tags/#capture) tags.
You can initialize Liquid variables with the [assign](/tags/#assign) or [capture](/tags/#capture) tags.
## String
Strings are declared by wrapping a variable's value in single or double quotes.
Declare a string by wrapping a variable's value in single or double quotes:
```liquid
{% raw %}
@@ -25,7 +25,7 @@ Strings are declared by wrapping a variable's value in single or double quotes.
## Number
Numbers include floats and integers.
Numbers include floats and integers:
```liquid
{% raw %}
@@ -36,7 +36,7 @@ Numbers include floats and integers.
## Boolean
Booleans are either `true` or `false`. No quotations are necessary when declaring a boolean.
Booleans are either `true` or `false`. No quotations are necessary when declaring a boolean:
```liquid
{% raw %}
@@ -49,7 +49,7 @@ Booleans are either `true` or `false`. No quotations are necessary when declarin
Nil is a special empty value that is returned when Liquid code has no results. It is **not** a string with the characters "nil".
Nil is treated as false in the conditions of `if` blocks and other Liquid tags that check the truthfulness of a statement.
Nil is [treated as false](/basics/truthy-and-falsy) in the conditions of `if` blocks and other Liquid tags that check the truthfulness of a statement.
In the following example, if the user does not exist (that is, `user` returns `nil`), Liquid will not print the greeting:
@@ -79,7 +79,7 @@ Arrays hold lists of variables of any type.
### Accessing items in arrays
To access all of the items in an array, you can loop through each item in the array using an [iteration tag](/tags/iteration/).
To access all the items in an array, you can loop through each item in the array using an [iteration tag](/tags/iteration/).
```liquid
{% raw %}
@@ -117,13 +117,13 @@ Adam
### Initializing arrays
You cannot initialize arrays using pure Liquid.
You cannot initialize arrays using only Liquid.
You can, however, use the [split](/filters/split) filter to break a single string into an array of substrings.
You can, however, use the [split](/filters/split) filter to break a string into an array of substrings.
## EmptyDrop
An EmptyDrop object is returned if you try to access a deleted object (such as a page or post) by its handle. In the example below, `page_1`, `page_2` and `page_3` are all EmptyDrop objects.
An EmptyDrop object is returned if you try to access a deleted object by name. In the example below, `page_1`, `page_2` and `page_3` are all EmptyDrop objects.
```liquid
{% raw %}
@@ -136,7 +136,7 @@ An EmptyDrop object is returned if you try to access a deleted object (such as a
EmptyDrop objects only have one attribute, `empty?`, which is always *true*.
Collections and pages that *do* exist do not have an `empty?` attribute. Their `empty?` is falsy, which means that calling it inside an if statement will return *false*. When using an unless statement on existing collections and pages, `empty?` will return `true`.
Collections and pages that *do* exist do not have an `empty?` attribute. Their `empty?` is "falsy", which means that calling it inside an if statement will return *false*. When using an `unless` statement on existing collections and pages, `empty?` will return `true`.
### Checking for emptiness
@@ -152,7 +152,7 @@ Using the `empty?` attribute, you can check to see if an object exists or not be
{% endraw %}
```
If you don't check for emptiness first, Liquid may print empty HTML elements to the page:
If you don't check for emptiness first, Liquid might print empty HTML elements to the page:
```html
<h1></h1>