Compare commits

...

25 Commits

Author SHA1 Message Date
Adam Hollett
0589cf4aac Remove raw tag from non-Liquid code blocks 2017-12-14 10:10:19 -05:00
Nithin Bekal
7cdc482bc4 Add docs for at_least and at_most filters 2017-12-06 11:58:00 -05:00
Adam Hollett
fbe0b39d85 Merge pull request #906 from Shopify/add-concat-filter
Add documentation for concat filter
2017-06-29 10:45:00 -04:00
Adam Hollett
ebf7f9232f Add documentation for concat filter 2017-06-22 11:04:23 -04:00
Adam Hollett
a0b0c608c1 Merge pull request #872 from j-f1/patch-1
Wrap capture example in {% raw %} and highlight it as Liquid
2017-06-22 10:49:00 -04:00
Adam Hollett
1db4219d2f Merge pull request #879 from joshaidan/gh-pages-new-features
Fixes #852: Undocumented Things
2017-03-30 10:25:12 -04:00
Brian Jones
8b6f4d2a45 Change Any Contents to Anything 2017-03-30 10:12:18 -04:00
Brian Jones
cee4a2d7ae Change title and filename to singular 2017-03-30 10:11:04 -04:00
Brian Jones
4bd5446a4e Fix raw tag and correct output 2017-03-30 09:58:10 -04:00
Brian Jones
2f703b30db Document some of the undocumented features 2017-03-29 23:01:40 -04:00
J F
2f8d447d90 Wrap capture example in {% raw %} and highlight it as Liquid 2017-03-18 13:44:08 -04:00
Justin Li
7ecc10b989 Merge pull request #845 from mrmanc/gh-pages
Clarifies spelling of for’s reversed flag to address #843
2017-02-10 19:26:43 -05:00
Justin Li
406b1813cf Merge pull request #856 from sergeifilippov/patch-1
Added a use case example for capture tag
2017-01-25 10:23:29 -05:00
Sergei Filippov
058dc2021d Added a use case example for capture tag 2017-01-24 14:29:14 +13:00
Mark Crossfield
49a41a3f08 Clarifies spelling of for’s reversed flag to address #843
It should now be harder to read the docs and miss the extra letter required for reversed compared to reverse, which causes a fairly generic syntax warning when trying to reverse sort a collection in a for loop.
2017-01-08 12:45:05 +00:00
Adam Hollett
61848f980b Bump gems. Set a space as the heading to disable this awful plugin 2016-12-19 10:18:01 -05:00
Adam Hollett
962e312fdc Try removing the include to fix the title 2016-12-19 10:13:13 -05:00
Adam Hollett
4a6de520db Try some different Liquid 2016-12-19 10:00:27 -05:00
Adam Hollett
9745bf309e Try setting a title and using Liquid to hide it 2016-12-19 09:53:02 -05:00
Adam Hollett
2a847e52fa Add logic to hide page title on index 2016-12-19 09:47:33 -05:00
Adam Hollett
5953c07346 Add default title to index page 2016-12-19 09:38:00 -05:00
Adam Hollett
4ccfaa470d Merge pull request #839 from Shopify/ditch-jquery
Remove jQuery
2016-12-16 13:17:27 -05:00
Adam Hollett
d1aa9a1fa1 Remove dollar signs from variables 2016-12-16 13:13:38 -05:00
Adam Hollett
bfca97f54d Get rid of jQuery 2016-12-16 11:35:08 -05:00
Adam Hollett
e79f0f364d Merge pull request #820 from Shopify/autumn-cleaning
Misc. documentation updates
2016-11-30 08:47:10 -05:00
13 changed files with 285 additions and 34 deletions

View File

@@ -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

View File

@@ -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>

View File

@@ -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
View 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
View 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
View 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
```

View File

@@ -1,5 +1,6 @@
---
layout: default
title: ' '
description: Documentation for the Liquid template language, created by Shopify.
---

View File

@@ -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');
});
});

File diff suppressed because one or more lines are too long

22
tags/comment.md Normal file
View 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.
```

View File

@@ -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 flags spelling is different to the filter `reverse`.
<p class="code-label">Input</p>
```liquid

22
tags/raw.md Normal file
View 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 %}
&#123;&#37; raw &#37;&#125;
In Handlebars, {{ this }} will be HTML-escaped, but
{{{ that }}} will not.
&#123;&#37; endraw &#37;&#125;
{% endraw %}</code>
</pre>
<p class="code-label">Output</p>
```text
{% raw %}In Handlebars, {{ this }} will be HTML-escaped, but {{{ that }}} will not.{% endraw %}
```

View File

@@ -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