mirror of
https://github.com/kemko/liquid.git
synced 2026-01-02 16:25:42 +03:00
Compare commits
25 Commits
autumn-cle
...
min-max-fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0589cf4aac | ||
|
|
7cdc482bc4 | ||
|
|
fbe0b39d85 | ||
|
|
ebf7f9232f | ||
|
|
a0b0c608c1 | ||
|
|
1db4219d2f | ||
|
|
8b6f4d2a45 | ||
|
|
cee4a2d7ae | ||
|
|
4bd5446a4e | ||
|
|
2f703b30db | ||
|
|
2f8d447d90 | ||
|
|
7ecc10b989 | ||
|
|
406b1813cf | ||
|
|
058dc2021d | ||
|
|
49a41a3f08 | ||
|
|
61848f980b | ||
|
|
962e312fdc | ||
|
|
4a6de520db | ||
|
|
9745bf309e | ||
|
|
2a847e52fa | ||
|
|
5953c07346 | ||
|
|
4ccfaa470d | ||
|
|
d1aa9a1fa1 | ||
|
|
bfca97f54d | ||
|
|
e79f0f364d |
89
Gemfile.lock
89
Gemfile.lock
@@ -7,36 +7,55 @@ GEM
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.3, >= 0.3.4)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.4.0)
|
||||
addressable (2.5.0)
|
||||
public_suffix (~> 2.0, >= 2.0.2)
|
||||
coffee-script (2.4.1)
|
||||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.10.0)
|
||||
coffee-script-source (1.12.2)
|
||||
colorator (1.1.0)
|
||||
ethon (0.9.1)
|
||||
ethon (0.10.1)
|
||||
ffi (>= 1.3.0)
|
||||
execjs (2.7.0)
|
||||
faraday (0.9.2)
|
||||
faraday (0.10.0)
|
||||
multipart-post (>= 1.2, < 3)
|
||||
ffi (1.9.14)
|
||||
forwardable-extended (2.6.0)
|
||||
gemoji (2.1.0)
|
||||
github-pages (104)
|
||||
github-pages (110)
|
||||
activesupport (= 4.2.7)
|
||||
github-pages-health-check (= 1.2.0)
|
||||
jekyll (= 3.3.0)
|
||||
github-pages-health-check (= 1.3.0)
|
||||
jekyll (= 3.3.1)
|
||||
jekyll-avatar (= 0.4.2)
|
||||
jekyll-coffeescript (= 1.0.1)
|
||||
jekyll-default-layout (= 0.1.4)
|
||||
jekyll-feed (= 0.8.0)
|
||||
jekyll-gist (= 1.4.0)
|
||||
jekyll-github-metadata (= 2.2.0)
|
||||
jekyll-mentions (= 1.2.0)
|
||||
jekyll-optional-front-matter (= 0.1.2)
|
||||
jekyll-paginate (= 1.1.0)
|
||||
jekyll-readme-index (= 0.0.3)
|
||||
jekyll-redirect-from (= 0.11.0)
|
||||
jekyll-relative-links (= 0.2.1)
|
||||
jekyll-sass-converter (= 1.3.0)
|
||||
jekyll-seo-tag (= 2.1.0)
|
||||
jekyll-sitemap (= 0.12.0)
|
||||
jekyll-swiss (= 0.4.0)
|
||||
jekyll-theme-architect (= 0.0.3)
|
||||
jekyll-theme-cayman (= 0.0.3)
|
||||
jekyll-theme-dinky (= 0.0.3)
|
||||
jekyll-theme-hacker (= 0.0.3)
|
||||
jekyll-theme-leap-day (= 0.0.3)
|
||||
jekyll-theme-merlot (= 0.0.3)
|
||||
jekyll-theme-midnight (= 0.0.3)
|
||||
jekyll-theme-minimal (= 0.0.3)
|
||||
jekyll-theme-modernist (= 0.0.3)
|
||||
jekyll-theme-primer (= 0.1.5)
|
||||
jekyll-theme-slate (= 0.0.3)
|
||||
jekyll-theme-tactile (= 0.0.3)
|
||||
jekyll-theme-time-machine (= 0.0.3)
|
||||
jekyll-titles-from-headings (= 0.1.2)
|
||||
jemoji (= 0.7.0)
|
||||
kramdown (= 1.11.1)
|
||||
liquid (= 3.0.6)
|
||||
@@ -45,17 +64,17 @@ GEM
|
||||
minima (= 2.0.0)
|
||||
rouge (= 1.11.1)
|
||||
terminal-table (~> 1.4)
|
||||
github-pages-health-check (1.2.0)
|
||||
github-pages-health-check (1.3.0)
|
||||
addressable (~> 2.3)
|
||||
net-dns (~> 0.8)
|
||||
octokit (~> 4.0)
|
||||
public_suffix (~> 1.4)
|
||||
public_suffix (~> 2.0)
|
||||
typhoeus (~> 0.7)
|
||||
html-pipeline (2.4.2)
|
||||
activesupport (>= 2)
|
||||
nokogiri (>= 1.4)
|
||||
i18n (0.7.0)
|
||||
jekyll (3.3.0)
|
||||
jekyll (3.3.1)
|
||||
addressable (~> 2.4)
|
||||
colorator (~> 1.0)
|
||||
jekyll-sass-converter (~> 1.0)
|
||||
@@ -70,6 +89,8 @@ GEM
|
||||
jekyll (~> 3.0)
|
||||
jekyll-coffeescript (1.0.1)
|
||||
coffee-script (~> 2.2)
|
||||
jekyll-default-layout (0.1.4)
|
||||
jekyll (~> 3.0)
|
||||
jekyll-feed (0.8.0)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-gist (1.4.0)
|
||||
@@ -81,9 +102,15 @@ GEM
|
||||
activesupport (~> 4.0)
|
||||
html-pipeline (~> 2.3)
|
||||
jekyll (~> 3.0)
|
||||
jekyll-optional-front-matter (0.1.2)
|
||||
jekyll (~> 3.0)
|
||||
jekyll-paginate (1.1.0)
|
||||
jekyll-readme-index (0.0.3)
|
||||
jekyll (~> 3.0)
|
||||
jekyll-redirect-from (0.11.0)
|
||||
jekyll (>= 2.0)
|
||||
jekyll-relative-links (0.2.1)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-sass-converter (1.3.0)
|
||||
sass (~> 3.2)
|
||||
jekyll-seo-tag (2.1.0)
|
||||
@@ -91,6 +118,34 @@ GEM
|
||||
jekyll-sitemap (0.12.0)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-swiss (0.4.0)
|
||||
jekyll-theme-architect (0.0.3)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-theme-cayman (0.0.3)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-theme-dinky (0.0.3)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-theme-hacker (0.0.3)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-theme-leap-day (0.0.3)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-theme-merlot (0.0.3)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-theme-midnight (0.0.3)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-theme-minimal (0.0.3)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-theme-modernist (0.0.3)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-theme-primer (0.1.5)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-theme-slate (0.0.3)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-theme-tactile (0.0.3)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-theme-time-machine (0.0.3)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-titles-from-headings (0.1.2)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-watch (1.5.0)
|
||||
listen (~> 3.0, < 3.1)
|
||||
jemoji (0.7.0)
|
||||
@@ -107,25 +162,25 @@ GEM
|
||||
mercenary (0.3.6)
|
||||
mini_portile2 (2.1.0)
|
||||
minima (2.0.0)
|
||||
minitest (5.9.1)
|
||||
minitest (5.10.1)
|
||||
multipart-post (2.0.0)
|
||||
net-dns (0.8.0)
|
||||
nokogiri (1.6.8.1)
|
||||
mini_portile2 (~> 2.1.0)
|
||||
octokit (4.6.0)
|
||||
octokit (4.6.2)
|
||||
sawyer (~> 0.8.0, >= 0.5.3)
|
||||
pathutil (0.14.0)
|
||||
forwardable-extended (~> 2.6)
|
||||
public_suffix (1.5.3)
|
||||
public_suffix (2.0.4)
|
||||
rb-fsevent (0.9.8)
|
||||
rb-inotify (0.9.7)
|
||||
ffi (>= 0.5.0)
|
||||
rouge (1.11.1)
|
||||
safe_yaml (1.0.4)
|
||||
sass (3.4.22)
|
||||
sawyer (0.8.0)
|
||||
sawyer (0.8.1)
|
||||
addressable (>= 2.3.5, < 2.6)
|
||||
faraday (~> 0.8, < 0.10)
|
||||
faraday (~> 0.8, < 1.0)
|
||||
terminal-table (1.7.3)
|
||||
unicode-display_width (~> 1.1.1)
|
||||
thread_safe (0.3.5)
|
||||
@@ -133,7 +188,7 @@ GEM
|
||||
ethon (>= 0.8.0)
|
||||
tzinfo (1.2.2)
|
||||
thread_safe (~> 0.1)
|
||||
unicode-display_width (1.1.1)
|
||||
unicode-display_width (1.1.2)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
@@ -142,4 +197,4 @@ DEPENDENCIES
|
||||
github-pages (>= 100)
|
||||
|
||||
BUNDLED WITH
|
||||
1.13.1
|
||||
1.13.3
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
<meta name="twitter:url" content="{{ site.url | append: site.baseurl }}">
|
||||
<meta name="twitter:title" content="{{ page.title | default: site.title }}">
|
||||
<meta name="twitter:description" content="{{ page.description | default: site.description }}">
|
||||
|
||||
<script src="{{ '/js/vendor/jquery-3.1.1.slim.min.js' | prepend: site.baseurl }}"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -47,7 +45,7 @@
|
||||
<span aria-hidden="true">{% include icons/three-bars.svg %}</span>
|
||||
<span>Menu</span>
|
||||
</button>
|
||||
<h1>{{ page.title }}</h1>
|
||||
{% if page.title %}<h1>{{ page.title }}</h1>{% endif %}
|
||||
{{ content }}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@@ -68,3 +68,17 @@ You can read more about each type of tag in their respective sections.
|
||||
```text
|
||||
{{ "/my/fancy/url" | append: ".html" }}
|
||||
```
|
||||
|
||||
Multiple filters can be used on one output. They are applied from left to right.
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
```liquid
|
||||
{% raw %}
|
||||
{{ "adam!" | capitalize | prepend: "Hello " }}
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
<p class="code-label">Output</p>
|
||||
```text
|
||||
Hello Adam!
|
||||
```
|
||||
|
||||
30
filters/at_least.md
Normal file
30
filters/at_least.md
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
title: at_least
|
||||
description: Liquid filter that limits a number to a minimum value
|
||||
---
|
||||
|
||||
Limits a number to a minimum value.
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
{% raw %}
|
||||
```liquid
|
||||
{{ 4 | at_least: 5 }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
<p class="code-label">Output</p>
|
||||
```
|
||||
5
|
||||
```
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
{% raw %}
|
||||
```liquid
|
||||
{{ 4 | at_least: 3 }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
<p class="code-label">Output</p>
|
||||
```
|
||||
4
|
||||
```
|
||||
30
filters/at_most.md
Normal file
30
filters/at_most.md
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
title: at_most
|
||||
description: Liquid filter that limits a number to a maximum value
|
||||
---
|
||||
|
||||
Limits a number to a maximum value.
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
{% raw %}
|
||||
```liquid
|
||||
{{ 4 | at_most: 5 }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
<p class="code-label">Output</p>
|
||||
```
|
||||
4
|
||||
```
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
{% raw %}
|
||||
```liquid
|
||||
{{ 4 | at_most: 3 }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
<p class="code-label">Output</p>
|
||||
```
|
||||
3
|
||||
```
|
||||
58
filters/concat.md
Normal file
58
filters/concat.md
Normal file
@@ -0,0 +1,58 @@
|
||||
---
|
||||
title: concat
|
||||
description: Liquid filter that concatenates arrays.
|
||||
---
|
||||
|
||||
Concatenates (joins together) multiple arrays. The resulting array contains all the items from the input arrays.
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
{% raw %}
|
||||
```liquid
|
||||
{% assign fruits = "apples, oranges, peaches" | split: ", " %}
|
||||
{% assign vegetables = "carrots, turnips, potatoes" | split: ", " %}
|
||||
|
||||
{% assign everything = fruits | concat: vegetables %}
|
||||
|
||||
{% for item in everything %}
|
||||
- {{ item }}
|
||||
{% endfor %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
<p class="code-label">Output</p>
|
||||
```text
|
||||
- apples
|
||||
- oranges
|
||||
- peaches
|
||||
- carrots
|
||||
- turnips
|
||||
- potatoes
|
||||
```
|
||||
|
||||
You can string together `concat` filters to join more than two arrays:
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
{% raw %}
|
||||
```liquid
|
||||
{% assign furniture = "chairs, tables, shelves" | split: ", " %}
|
||||
|
||||
{% assign everything = fruits | concat: vegetables | concat: furniture %}
|
||||
|
||||
{% for item in everything %}
|
||||
- {{ item }}
|
||||
{% endfor %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
<p class="code-label">Output</p>
|
||||
```text
|
||||
- apples
|
||||
- oranges
|
||||
- peaches
|
||||
- carrots
|
||||
- turnips
|
||||
- potatoes
|
||||
- chairs
|
||||
- tables
|
||||
- shelves
|
||||
```
|
||||
1
index.md
1
index.md
@@ -1,5 +1,6 @@
|
||||
---
|
||||
layout: default
|
||||
title: ' '
|
||||
description: Documentation for the Liquid template language, created by Shopify.
|
||||
---
|
||||
|
||||
|
||||
23
js/script.js
23
js/script.js
@@ -1,12 +1,17 @@
|
||||
$menuButton = $(".menu-button");
|
||||
$sidebar = $(".sidebar");
|
||||
$contentOverlay = $(".content__overlay");
|
||||
var menuButton = document.querySelector('.menu-button');
|
||||
var sidebar = document.querySelector('.sidebar');
|
||||
var contentOverlay = document.querySelector('.content__overlay');
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$menuButton.add($contentOverlay).on("click", function() {
|
||||
$sidebar.toggleClass("sidebar--is-visible");
|
||||
$contentOverlay.toggleClass("content__overlay--is-active");
|
||||
menuButton.addEventListener('click', function() {
|
||||
sidebar.classList.toggle('sidebar--is-visible');
|
||||
contentOverlay.classList.toggle('content__overlay--is-active');
|
||||
});
|
||||
})
|
||||
|
||||
contentOverlay.addEventListener('click', function() {
|
||||
sidebar.classList.toggle('sidebar--is-visible');
|
||||
contentOverlay.classList.toggle('content__overlay--is-active');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
4
js/vendor/jquery-3.1.1.slim.min.js
vendored
4
js/vendor/jquery-3.1.1.slim.min.js
vendored
File diff suppressed because one or more lines are too long
22
tags/comment.md
Normal file
22
tags/comment.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: Comment
|
||||
description: An overview of comments tags in the Liquid template language.
|
||||
---
|
||||
|
||||
Allows you to leave un-rendered code inside a Liquid template. Any text within
|
||||
the opening and closing `comment` blocks will not be output, and any Liquid code
|
||||
within will not be executed.
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
```liquid
|
||||
{% raw %}
|
||||
Anything you put between {% comment %} and {% endcomment %} tags
|
||||
is turned into a comment.
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
<p class="code-label">Output</p>
|
||||
```liquid
|
||||
Anything you put between {% comment %} and {% endcomment %} tags
|
||||
is turned into a comment.
|
||||
```
|
||||
@@ -133,7 +133,7 @@ Defines a range of numbers to loop through. The range can be defined by both lit
|
||||
|
||||
### reversed
|
||||
|
||||
Reverses the order of the loop.
|
||||
Reverses the order of the loop. Note that the flag’s spelling is different to the filter `reverse`.
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
```liquid
|
||||
|
||||
22
tags/raw.md
Normal file
22
tags/raw.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
title: Raw
|
||||
description: An overview of raw tags in the Liquid template language.
|
||||
---
|
||||
|
||||
Raw temporarily disables tag processing. This is useful for generating content
|
||||
(eg, Mustache, Handlebars) which uses conflicting syntax.
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
<pre class="highlight">
|
||||
<code>{% raw %}
|
||||
{% raw %}
|
||||
In Handlebars, {{ this }} will be HTML-escaped, but
|
||||
{{{ that }}} will not.
|
||||
{% endraw %}
|
||||
{% endraw %}</code>
|
||||
</pre>
|
||||
|
||||
<p class="code-label">Output</p>
|
||||
```text
|
||||
{% raw %}In Handlebars, {{ this }} will be HTML-escaped, but {{{ that }}} will not.{% endraw %}
|
||||
```
|
||||
@@ -55,6 +55,26 @@ Captures the string inside of the opening and closing tags and assigns it to a v
|
||||
```text
|
||||
I am being captured.
|
||||
```
|
||||
Using `capture`, you can create complex strings using other variables created with `assign`.
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
```liquid
|
||||
{% raw %}
|
||||
{% assign favorite_food = 'pizza' %}
|
||||
{% assign age = 35 %}
|
||||
|
||||
{% capture about_me %}
|
||||
I am {{ age }} and my favorite food is {{ favorite_food }}.
|
||||
{% endcapture %}
|
||||
|
||||
{{ about_me }}
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
<p class="code-label">Output</p>
|
||||
```text
|
||||
I am 35 and my favourite food is pizza.
|
||||
```
|
||||
|
||||
## increment
|
||||
|
||||
|
||||
Reference in New Issue
Block a user