mirror of
https://github.com/kemko/liquid.git
synced 2026-01-05 01:35:41 +03:00
Update Gruntfile to work with Adam's changes
This commit is contained in:
@@ -16,7 +16,7 @@ require('load-grunt-tasks')(grunt);
|
||||
}
|
||||
},
|
||||
jekyll: {
|
||||
files: ['index.md', '_includes/*.html', '_filters/*.*', '_layouts/*.*', '_tags/*.*', '_basics/*.*'],
|
||||
files: ['index.md', '_includes/*.html', 'filters/*.*', '_layouts/*.*', 'tags/*.*', 'basics/*.*'],
|
||||
tasks: ['shell:jekyllBuild']
|
||||
}
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Handles
|
||||
---
|
||||
|
||||
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 (-).
|
||||
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 (-).
|
||||
|
||||
For example, a page with the title "About Us" can be accessed in Liquid via its handle `about-us` as shown below:
|
||||
|
||||
@@ -13,7 +13,7 @@ For example, a page with the title "About Us" can be accessed in Liquid via its
|
||||
{% endraw %}
|
||||
{% endhighlight %}
|
||||
|
||||
### Creating handles
|
||||
## Creating handles
|
||||
|
||||
An object with the title "Shirt" will automatically be given the handle `shirt`. If there is already an object with the handle `shirt`, the handle will auto-increment. In other words, "Shirt" objects created after the first one will receive the handle `shirt-1`, `shirt-2`, and so on.
|
||||
|
||||
@@ -25,7 +25,7 @@ Websites often rely on static handles for pages, posts, or objects. To preserve
|
||||
|
||||
You can change an object's handle manually (TK how to change a handle manually)
|
||||
|
||||
### Accessing handle attributes
|
||||
## Accessing handle attributes
|
||||
|
||||
In many cases you may know the handle of a object whose attributes you want to access. You can access its attributes by pluralizing the name of the object, then using either the square bracket ( [ ] ) or dot ( . ) notation.
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
---
|
||||
category: control-flow
|
||||
---
|
||||
|
||||
|
||||
## case/when
|
||||
|
||||
<p>Creates a switch statement to compare a variable with different values. <code>case</code> initializes the switch statement, and <code>when</code> compares its values.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
|
||||
<div>
|
||||
{% 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 %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
This is a cake
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
@@ -1,26 +0,0 @@
|
||||
## elsif / else
|
||||
|
||||
<p>Adds more conditions within an <code>if</code> or <code>unless</code> block.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<!-- If customer.name = 'anonymous' -->
|
||||
{% if customer.name == 'kevin' %}
|
||||
Hey Kevin!
|
||||
{% elsif customer.name == 'anonymous' %}
|
||||
Hey Anonymous!
|
||||
{% else %}
|
||||
Hi Stranger!
|
||||
{% endif %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Hey Anonymous!
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
@@ -1,21 +0,0 @@
|
||||
## if
|
||||
|
||||
<p>Executes a block of code only if a certain condition is met.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% if product.title == 'Awesome Shoes' %}
|
||||
These shoes are awesome!
|
||||
{% endif %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
These shoes are awesome!
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
@@ -1,14 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
TAGS!
|
||||
|
||||
{% for doc in site.collections["tags"].docs %}
|
||||
<div id="{{ doc.title }}" class="content__item">
|
||||
<h2 class="content__header">{{ doc.title }}</h2>
|
||||
<div class="content">
|
||||
{{ doc.content }}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
@@ -1,31 +0,0 @@
|
||||
## unless
|
||||
|
||||
<p>Similar to <code>if</code>, but executes a block of code only if a certain condition is <strong>not</strong> met.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% unless product.title == 'Awesome Shoes' %}
|
||||
These shoes are not awesome.
|
||||
{% endunless %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
These shoes are not awesome.
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
This would be the equivalent of doing the following:
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% if product.title != 'Awesome Shoes' %}
|
||||
These shoes are not awesome.
|
||||
{% endif %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
sss
|
||||
|
||||
{{ site.collections["tags"] }}
|
||||
|
||||
{% for doc in site.collections["tags"].docs %}
|
||||
|
||||
{% endfor %}
|
||||
Reference in New Issue
Block a user