From 1e769d9263703a46885cc8df0fa0a52cd0415d9d Mon Sep 17 00:00:00 2001 From: Adam Hollett Date: Fri, 4 Dec 2015 20:05:47 -0500 Subject: [PATCH 1/3] Cleanup and config reorg --- _config.yml | 17 +++++++++------ _data/site.yml | 6 ------ _layouts/default.html | 4 ++-- docs/tags/control-flow/case-when.md | 32 ---------------------------- docs/tags/control-flow/elsif-else.md | 26 ---------------------- docs/tags/control-flow/if.md | 21 ------------------ docs/tags/control-flow/index.html | 14 ------------ docs/tags/control-flow/unless.md | 31 --------------------------- docs/tags/index.html | 11 ---------- feed.xml | 4 ++-- 10 files changed, 15 insertions(+), 151 deletions(-) delete mode 100644 _data/site.yml delete mode 100644 docs/tags/control-flow/case-when.md delete mode 100644 docs/tags/control-flow/elsif-else.md delete mode 100644 docs/tags/control-flow/if.md delete mode 100644 docs/tags/control-flow/index.html delete mode 100644 docs/tags/control-flow/unless.md delete mode 100644 docs/tags/index.html diff --git a/_config.yml b/_config.yml index e4682e21..4f02ad09 100644 --- a/_config.yml +++ b/_config.yml @@ -1,14 +1,19 @@ +title: Liquid Templating Engine +description: "Liquid is a template language and accompanying rendering engine. It is built for security, so is perfect for rendering custom templates from your users." + # Build settings -baseurl: "" # the subpath of your site, e.g. /blog/ -url: "http://liquidmarkup.org" # the base hostname & protocol for your site -markdown: kramdown -highlighter: pygments -permalink: /:year/:month/:day/:basename:output_ext +baseurl: "" # the subpath of your site, e.g. /blog/ +url: http://liquidmarkup.org # the base hostname & protocol for your site +markdown: kramdown +highlighter: pygments +permalink: /:year/:month/:day/:basename:output_ext exclude: - README.md - CNAME - node_modules -keep_files: ['css'] +keep_files: ['css'] + +# Front matter defaults defaults: - scope: path: "" # an empty string here means all files in the project diff --git a/_data/site.yml b/_data/site.yml deleted file mode 100644 index 9c60ea98..00000000 --- a/_data/site.yml +++ /dev/null @@ -1,6 +0,0 @@ -# Site settings -title: Liquid Templating Engine -description: > # this means to ignore newlines until "baseurl:" - Liquid is a template language and accompanying rendering engine. - It is built for security, so is perfect for rendering custom - templates from your users. diff --git a/_layouts/default.html b/_layouts/default.html index 28a03eb8..1c507a14 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,12 +1,12 @@ - {% if page.title %}{{ page.title }} – {% endif %}{{ site.data.site.title }} + {% if page.title %}{{ page.title }} – {% endif %}{{ site.title }} - + diff --git a/docs/tags/control-flow/case-when.md b/docs/tags/control-flow/case-when.md deleted file mode 100644 index ddc67c8c..00000000 --- a/docs/tags/control-flow/case-when.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -category: control-flow ---- - - -## case/when - -

Creates a switch statement to compare a variable with different values. case initializes the switch statement, and when compares its values.

- -

Input

- -
-{% highlight html %}{% raw %} -{% assign handle = 'cake' %} -{% case handle %} - {% when 'cake' %} - This is a cake - {% when 'cookie' %} - This is a cookie - {% else %} - This is not a cake nor a cookie -{% endcase %} -{% endraw %}{% endhighlight %} -
- -

Output

- -
-{% highlight html %}{% raw %} -This is a cake -{% endraw %}{% endhighlight %} -
diff --git a/docs/tags/control-flow/elsif-else.md b/docs/tags/control-flow/elsif-else.md deleted file mode 100644 index e08623d1..00000000 --- a/docs/tags/control-flow/elsif-else.md +++ /dev/null @@ -1,26 +0,0 @@ -## elsif / else - -

Adds more conditions within an if or unless block.

- -

Input

- -
-{% highlight html %}{% raw %} - - {% if customer.name == 'kevin' %} - Hey Kevin! - {% elsif customer.name == 'anonymous' %} - Hey Anonymous! - {% else %} - Hi Stranger! - {% endif %} -{% endraw %}{% endhighlight %} -
- -

Output

- -
-{% highlight html %}{% raw %} -Hey Anonymous! -{% endraw %}{% endhighlight %} -
diff --git a/docs/tags/control-flow/if.md b/docs/tags/control-flow/if.md deleted file mode 100644 index f41b842a..00000000 --- a/docs/tags/control-flow/if.md +++ /dev/null @@ -1,21 +0,0 @@ -## if - -

Executes a block of code only if a certain condition is met.

- -

Input

- -
-{% highlight html %}{% raw %} -{% if product.title == 'Awesome Shoes' %} - These shoes are awesome! -{% endif %} -{% endraw %}{% endhighlight %} -
- -

Output

- -
-{% highlight html %}{% raw %} -These shoes are awesome! -{% endraw %}{% endhighlight %} -
diff --git a/docs/tags/control-flow/index.html b/docs/tags/control-flow/index.html deleted file mode 100644 index 9d08db02..00000000 --- a/docs/tags/control-flow/index.html +++ /dev/null @@ -1,14 +0,0 @@ ---- -layout: default ---- - -TAGS! - -{% for doc in site.collections["tags"].docs %} -
-

{{ doc.title }}

-
- {{ doc.content }} -
-
-{% endfor %} diff --git a/docs/tags/control-flow/unless.md b/docs/tags/control-flow/unless.md deleted file mode 100644 index 3733404c..00000000 --- a/docs/tags/control-flow/unless.md +++ /dev/null @@ -1,31 +0,0 @@ -## unless - -

Similar to if, but executes a block of code only if a certain condition is not met.

- -

Input

- -
-{% highlight html %}{% raw %} - {% unless product.title == 'Awesome Shoes' %} - These shoes are not awesome. - {% endunless %} -{% endraw %}{% endhighlight %} -
- -

Output

- -
-{% highlight html %}{% raw %} -These shoes are not awesome. -{% endraw %}{% endhighlight %} -
- -This would be the equivalent of doing the following: - -
-{% highlight html %}{% raw %} - {% if product.title != 'Awesome Shoes' %} - These shoes are not awesome. - {% endif %} -{% endraw %}{% endhighlight %} -
diff --git a/docs/tags/index.html b/docs/tags/index.html deleted file mode 100644 index f0cf8540..00000000 --- a/docs/tags/index.html +++ /dev/null @@ -1,11 +0,0 @@ ---- -layout: default ---- - -sss - -{{ site.collections["tags"] }} - -{% for doc in site.collections["tags"].docs %} - -{% endfor %} diff --git a/feed.xml b/feed.xml index 3aede089..a6628bd8 100644 --- a/feed.xml +++ b/feed.xml @@ -4,8 +4,8 @@ layout: null - {{ site.data.site.title | xml_escape }} - {{ site.data.site.description | xml_escape }} + {{ site.title | xml_escape }} + {{ site.description | xml_escape }} {{ site.url }}{{ site.baseurl }}/ {{ site.time | date_to_rfc822 }} From 90825277d30aa52a07c6cb48132d2fb002de7ac3 Mon Sep 17 00:00:00 2001 From: Adam Hollett Date: Fri, 4 Dec 2015 20:52:47 -0500 Subject: [PATCH 2/3] Small fixes --- basics/handles.md | 2 +- index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/basics/handles.md b/basics/handles.md index 023fee12..40c0e60a 100644 --- a/basics/handles.md +++ b/basics/handles.md @@ -2,7 +2,7 @@ title: Handles --- -sss A handle is used to access the attributes of a Liquid object. By default, the handle is the object's title in lowercase with any spaces and special characters replaced by hyphens (-). +A handle is used to access the attributes of a Liquid object. By default, the handle 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: diff --git a/index.md b/index.md index 5fa664e6..538410ba 100644 --- a/index.md +++ b/index.md @@ -4,7 +4,7 @@ layout: default {% include home-banner.html %} -Liquid is an open-source template language created by [Shopify](https://www.shopify.com) and written in Ruby. It is the backbone of Shopify themes and is used to load dynamic content on storefronts. Liquid is also used in static site genrators like [Jekyll](http://jekyllrb.com). +Liquid is an open-source template language created by [Shopify](https://www.shopify.com) and written in Ruby. It is the backbone of Shopify themes and is used to load dynamic content on storefronts. Liquid is also used in static site generators like [Jekyll](http://jekyllrb.com). Liquid has been in production use since June 2006 and is now used by many other hosted web applications. From 1ce90ed35592682f7ee48296990f1399d0f00b15 Mon Sep 17 00:00:00 2001 From: Adam Hollett Date: Fri, 4 Dec 2015 21:16:07 -0500 Subject: [PATCH 3/3] Refactor config and sidebar --- _config.yml | 14 +-------- _includes/sidebar.html | 28 +++++++++++++++++ _layouts/default.html | 63 +------------------------------------- basics/truthy-and-falsy.md | 2 +- tags/control.flow.md | 3 +- 5 files changed, 32 insertions(+), 78 deletions(-) create mode 100644 _includes/sidebar.html diff --git a/_config.yml b/_config.yml index 4f02ad09..1e275b9e 100644 --- a/_config.yml +++ b/_config.yml @@ -6,7 +6,7 @@ baseurl: "" # the subpath of your site, e.g. /blog/ url: http://liquidmarkup.org # the base hostname & protocol for your site markdown: kramdown highlighter: pygments -permalink: /:year/:month/:day/:basename:output_ext +permalink: pretty exclude: - README.md - CNAME @@ -19,15 +19,3 @@ defaults: path: "" # an empty string here means all files in the project values: layout: "default" - - scope: - path: "basics" - values: - type: "basics" - - scope: - path: "filters" - values: - type: "filters" - - scope: - path: "tags" - values: - type: "tags" diff --git a/_includes/sidebar.html b/_includes/sidebar.html new file mode 100644 index 00000000..bd262e1e --- /dev/null +++ b/_includes/sidebar.html @@ -0,0 +1,28 @@ + diff --git a/_layouts/default.html b/_layouts/default.html index 1c507a14..41cf3522 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -16,68 +16,7 @@ - + {% include sidebar.html %}
diff --git a/basics/truthy-and-falsy.md b/basics/truthy-and-falsy.md index dddee83a..8b75b834 100644 --- a/basics/truthy-and-falsy.md +++ b/basics/truthy-and-falsy.md @@ -1,5 +1,5 @@ --- -title: Truthy and Falsy +title: Truthy and falsy --- In programming, anything that returns `true` in a conditional is called **truthy**. Anything that returns `false` in a conditional is called **falsy**. All object types can be described as either truthy or falsy. diff --git a/tags/control.flow.md b/tags/control.flow.md index 881df7df..cb8fcadb 100644 --- a/tags/control.flow.md +++ b/tags/control.flow.md @@ -1,8 +1,7 @@ --- +title: Control flow --- -TAGS! - ## case/when

Creates a switch statement to compare a variable with different values. case initializes the switch statement, and when compares its values.