From 57ccbd48982b09b2771fedd0e6584b1474ed779d Mon Sep 17 00:00:00 2001 From: Tetsuro Date: Fri, 28 Aug 2015 12:28:11 -0400 Subject: [PATCH] Re-organizing basics content, starting to remove Shopify-specific content --- Gruntfile.js | 4 +--- _basics/handle.md | 13 +++-------- _basics/operators.md | 11 +++------ _basics/temp-index.md | 40 -------------------------------- _basics/true-and-false.md | 4 ---- _includes/home-banner.html | 8 +++++++ _sass/modules/_page-content.scss | 4 ++++ basics/index.html | 2 +- filters/index.html | 2 +- index.html | 25 -------------------- index.md | 34 +++++++++++++++++++++++++++ tags/index.html | 2 +- 12 files changed, 56 insertions(+), 93 deletions(-) delete mode 100644 _basics/temp-index.md create mode 100644 _includes/home-banner.html delete mode 100644 index.html create mode 100644 index.md diff --git a/Gruntfile.js b/Gruntfile.js index a197524..ba8dd39 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -15,12 +15,10 @@ require('load-grunt-tasks')(grunt); atBegin: true } }, - jekyll: { - files: ['index.html', '_includes/*.html', '_filters/*.*', '_layouts/*.*', '_posts/*.*'], + files: ['index.md', '_includes/*.html', '_filters/*.*', '_layouts/*.*', '_tags/*.*', '_basics/*.*'], tasks: ['shell:jekyllBuild'] } - }, sass: { diff --git a/_basics/handle.md b/_basics/handle.md index 55e0e63..2538fa3 100644 --- a/_basics/handle.md +++ b/_basics/handle.md @@ -2,16 +2,9 @@ title: Handles --- -# Handles +### What is a handle - - - - - -## What is a handle - -The handle is used to access the attributes of a Liquid object. By default, it is the object's title in lowercase with any spaces and special characters replaced by hyphens (-). Every object in Liquid (product, collection, blog, link list) has a handle. +The handle is used to access the attributes of a Liquid object. By default, it is the object's title in lowercase with any spaces and special characters replaced by hyphens (-). For example, a page with the title "About Us" can be accessed in Liquid via its handle about-us as shown below: @@ -20,7 +13,7 @@ For example, a page with the title "About Us" can be accessed in Liquid via its {{ pages.about-us.content }} {% endraw %}{% endhighlight %} -## How are my handles created? +### How are my handles created? A product with the title "Shirt" will automatically be given the handle **shirt**. If there is already a product with the handle "Shirt", the handle will auto-increment. In other words, all "Shirt" products created after the first one will receive the handle **shirt-1**, **shirt-2**, and so on. diff --git a/_basics/operators.md b/_basics/operators.md index 0f5b7cc..2d63208 100644 --- a/_basics/operators.md +++ b/_basics/operators.md @@ -2,14 +2,9 @@ title: Operators --- -# Operators +Liquid has access to all of the logical and comparison operators. - - -Liquid has access to all of the logical and comparison operators. These can be used in tags such as if and unless. - - -## Basic Operators +### Basic Operators @@ -77,7 +72,7 @@ Operators can be chained together. -## Contains operator +### Contains operator contains checks for the presence of a substring inside a string. diff --git a/_basics/temp-index.md b/_basics/temp-index.md deleted file mode 100644 index ae46193..0000000 --- a/_basics/temp-index.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: Basics ---- - - -# Introduction - -Liquid is an open-source, Ruby-based template language created by Shopify. It is the backbone of Shopify themes and is used to load dynamic content on storefronts. - - - -Liquid uses a combination of _tags_, _objects_, and _filters_ to load dynamic content. They are used inside Liquid _template files_, which are a group of files that make up a theme. For more information on the available templates, please see Theme Development. - -## Tags - -Tags make up the programming logic that tells templates what to do. - -{% raw %} -{% if user.name == 'elvis' %} - Hey Elvis -{% endif %} -{% endraw %} - - - - - - - - -## Filters - -Filters are used to modify the output of strings, numbers, variables, and objects. - -{% raw %} -{{ 'sales' | append: '.jpg' }} -{% endraw %} -

-Read more › -

\ No newline at end of file diff --git a/_basics/true-and-false.md b/_basics/true-and-false.md index a3ef1d5..e4f3bd5 100644 --- a/_basics/true-and-false.md +++ b/_basics/true-and-false.md @@ -2,10 +2,6 @@ title: Truthy and Falsy --- -# Truthy and Falsy in Liquid - - - In programming, we describe “truthy” and “falsy” as anything that returns true or false, respectively, when used inside an if statement. ## What is truthy? diff --git a/_includes/home-banner.html b/_includes/home-banner.html new file mode 100644 index 0000000..06a5c5b --- /dev/null +++ b/_includes/home-banner.html @@ -0,0 +1,8 @@ +
+

Liquid

+

Ruby library for rendering safe templates which cannot affect the security of the server they are rendered on.

+

+ Download + View on Github +

+
diff --git a/_sass/modules/_page-content.scss b/_sass/modules/_page-content.scss index 40918e1..2f6a530 100644 --- a/_sass/modules/_page-content.scss +++ b/_sass/modules/_page-content.scss @@ -12,3 +12,7 @@ p { .content__item { margin-bottom: $spacing-unit * 2; } + + .content__header { + font-weight: bold; + } diff --git a/basics/index.html b/basics/index.html index bd04fd4..ec015db 100644 --- a/basics/index.html +++ b/basics/index.html @@ -4,7 +4,7 @@ layout: default {% for doc in site.collections["basics"].docs %}
-

{{ doc.title }}

+

{{ doc.title }}

{{ doc.content }}
diff --git a/filters/index.html b/filters/index.html index a7141df..54a693d 100644 --- a/filters/index.html +++ b/filters/index.html @@ -4,7 +4,7 @@ layout: default {% for doc in site.collections["filters"].docs %}
-

{{ doc.title }}

+

{{ doc.title }}

{{ doc.content }}
diff --git a/index.html b/index.html deleted file mode 100644 index 81d9e91..0000000 --- a/index.html +++ /dev/null @@ -1,25 +0,0 @@ ---- -layout: default ---- - -
- -
-

Liquid

-

Ruby library for rendering safe templates which cannot affect the security of the server they are rendered on.

-

- Download - View on Github -

-
- -

Liquid is an extraction from the e-commerce system Shopify. Shopify powers many thousands of e-commerce stores which all call for unique designs. For this we developed Liquid which allows our customers complete design freedom while maintaining the integrity of our servers.

- -

Liquid has been in production use since June 2006 and is now used by many other hosted web applications.

- -

It was developed for usage in Ruby on Rails web applications and integrates seamlessly as a plugin but it also works excellently as a stand alone library.

- - # What does it look like??? - - -
diff --git a/index.md b/index.md new file mode 100644 index 0000000..6426b8b --- /dev/null +++ b/index.md @@ -0,0 +1,34 @@ +--- +layout: default +--- + +{% include home-banner.html %} + +

Liquid is an extraction from the e-commerce system Shopify. Shopify powers many thousands of e-commerce stores which all call for unique designs. For this we developed Liquid which allows our customers complete design freedom while maintaining the integrity of our servers.

+ +

Liquid has been in production use since June 2006 and is now used by many other hosted web applications.

+ +

It was developed for usage in Ruby on Rails web applications and integrates seamlessly as a plugin but it also works excellently as a stand alone library.

+ +Liquid is an open-source, Ruby-based template language created by Shopify. It is the backbone of Shopify themes and is used to load dynamic content on storefronts. + +Liquid uses a combination of _tags_, _objects_, and _filters_ to load dynamic content. They are used inside Liquid _template files_, which are a group of files that make up a theme. For more information on the available templates, please see Theme Development. + +## Tags + +Tags make up the programming logic that tells templates what to do. + +{% raw %} +{% if user.name == 'elvis' %} + Hey Elvis +{% endif %} +{% endraw %} + + +## Filters + +Filters are used to modify the output of strings, numbers, variables, and objects. + +{% raw %} +{{ 'sales' | append: '.jpg' }} +{% endraw %} diff --git a/tags/index.html b/tags/index.html index d0fdac2..febf7ef 100644 --- a/tags/index.html +++ b/tags/index.html @@ -4,7 +4,7 @@ layout: default {% for doc in site.collections["tags"].docs %}
-

{{ doc.title }}

+

{{ doc.title }}

{{ doc.content }}