Fix up miscellaneous things and remove some deps

This commit is contained in:
Adam Hollett
2016-11-08 16:23:33 -05:00
parent aa35b3f3fd
commit aef8bd5642
62 changed files with 280 additions and 137 deletions

View File

@@ -1,3 +1,3 @@
source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
gem 'github-pages', '>=100', group: :jekyll_plugins

View File

@@ -1,8 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
RedCloth (4.2.9)
activesupport (4.2.6)
activesupport (4.2.7)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
@@ -13,121 +12,134 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.10.0)
colorator (0.1)
ethon (0.8.1)
colorator (1.1.0)
ethon (0.9.1)
ffi (>= 1.3.0)
execjs (2.6.0)
execjs (2.7.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.10)
ffi (1.9.14)
forwardable-extended (2.6.0)
gemoji (2.1.0)
github-pages (68)
RedCloth (= 4.2.9)
github-pages-health-check (= 1.1.0)
jekyll (= 3.0.3)
github-pages (104)
activesupport (= 4.2.7)
github-pages-health-check (= 1.2.0)
jekyll (= 3.3.0)
jekyll-avatar (= 0.4.2)
jekyll-coffeescript (= 1.0.1)
jekyll-feed (= 0.4.0)
jekyll-feed (= 0.8.0)
jekyll-gist (= 1.4.0)
jekyll-github-metadata (= 1.10.0)
jekyll-mentions (= 1.1.2)
jekyll-github-metadata (= 2.2.0)
jekyll-mentions (= 1.2.0)
jekyll-paginate (= 1.1.0)
jekyll-redirect-from (= 0.10.0)
jekyll-redirect-from (= 0.11.0)
jekyll-sass-converter (= 1.3.0)
jekyll-seo-tag (= 1.3.3)
jekyll-sitemap (= 0.10.0)
jekyll-textile-converter (= 0.1.0)
jemoji (= 0.6.2)
kramdown (= 1.10.0)
jekyll-seo-tag (= 2.1.0)
jekyll-sitemap (= 0.12.0)
jekyll-swiss (= 0.4.0)
jemoji (= 0.7.0)
kramdown (= 1.11.1)
liquid (= 3.0.6)
listen (= 3.0.6)
mercenary (~> 0.3)
rdiscount (= 2.1.8)
redcarpet (= 3.3.3)
rouge (= 1.10.1)
minima (= 2.0.0)
rouge (= 1.11.1)
terminal-table (~> 1.4)
github-pages-health-check (1.1.0)
github-pages-health-check (1.2.0)
addressable (~> 2.3)
net-dns (~> 0.8)
octokit (~> 4.0)
public_suffix (~> 1.4)
typhoeus (~> 0.7)
html-pipeline (2.3.0)
activesupport (>= 2, < 5)
html-pipeline (2.4.2)
activesupport (>= 2)
nokogiri (>= 1.4)
i18n (0.7.0)
jekyll (3.0.3)
colorator (~> 0.1)
jekyll (3.3.0)
addressable (~> 2.4)
colorator (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 3.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (~> 1.7)
safe_yaml (~> 1.0)
jekyll-avatar (0.4.2)
jekyll (~> 3.0)
jekyll-coffeescript (1.0.1)
coffee-script (~> 2.2)
jekyll-feed (0.4.0)
jekyll-feed (0.8.0)
jekyll (~> 3.3)
jekyll-gist (1.4.0)
octokit (~> 4.2)
jekyll-github-metadata (1.10.0)
octokit (~> 4.0)
jekyll-mentions (1.1.2)
jekyll-github-metadata (2.2.0)
jekyll (~> 3.1)
octokit (~> 4.0, != 4.4.0)
jekyll-mentions (1.2.0)
activesupport (~> 4.0)
html-pipeline (~> 2.3)
jekyll (~> 3.0)
jekyll-paginate (1.1.0)
jekyll-redirect-from (0.10.0)
jekyll-redirect-from (0.11.0)
jekyll (>= 2.0)
jekyll-sass-converter (1.3.0)
sass (~> 3.2)
jekyll-seo-tag (1.3.3)
jekyll (~> 3.0)
jekyll-sitemap (0.10.0)
jekyll-textile-converter (0.1.0)
RedCloth (~> 4.0)
jekyll-watch (1.3.1)
listen (~> 3.0)
jemoji (0.6.2)
jekyll-seo-tag (2.1.0)
jekyll (~> 3.3)
jekyll-sitemap (0.12.0)
jekyll (~> 3.3)
jekyll-swiss (0.4.0)
jekyll-watch (1.5.0)
listen (~> 3.0, < 3.1)
jemoji (0.7.0)
activesupport (~> 4.0)
gemoji (~> 2.0)
html-pipeline (~> 2.2)
jekyll (>= 3.0)
json (1.8.3)
kramdown (1.10.0)
kramdown (1.11.1)
liquid (3.0.6)
listen (3.0.6)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9.7)
mercenary (0.3.5)
mini_portile2 (2.0.0)
minitest (5.8.4)
mercenary (0.3.6)
mini_portile2 (2.1.0)
minima (2.0.0)
minitest (5.9.1)
multipart-post (2.0.0)
net-dns (0.8.0)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
octokit (4.3.0)
sawyer (~> 0.7.0, >= 0.5.3)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
octokit (4.6.0)
sawyer (~> 0.8.0, >= 0.5.3)
pathutil (0.14.0)
forwardable-extended (~> 2.6)
public_suffix (1.5.3)
rb-fsevent (0.9.7)
rb-fsevent (0.9.8)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
rdiscount (2.1.8)
redcarpet (3.3.3)
rouge (1.10.1)
rouge (1.11.1)
safe_yaml (1.0.4)
sass (3.4.22)
sawyer (0.7.0)
addressable (>= 2.3.5, < 2.5)
sawyer (0.8.0)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 0.10)
terminal-table (1.5.2)
terminal-table (1.7.3)
unicode-display_width (~> 1.1.1)
thread_safe (0.3.5)
typhoeus (0.8.0)
ethon (>= 0.8.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
unicode-display_width (1.1.1)
PLATFORMS
ruby
DEPENDENCIES
github-pages
github-pages (>= 100)
BUNDLED WITH
1.11.2
1.13.1

View File

@@ -1,7 +1,5 @@
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."
repository: https://github.com/Shopify/liquid
title: Liquid templating language
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: /liquid # the subpath of your site, e.g. /blog/

View File

@@ -1,8 +1,12 @@
<div class="home-banner">
<h1>Liquid</h1>
<p>Safe, customer facing template language for flexible web apps.</p>
<p>Safe, customer-facing template language for flexible web apps.</p>
<p class="btn-row">
<a href="https://github.com/Shopify/liquid/archive/master.zip" target="_blank" class="btn"><i class="icon fa fa-2x fa-arrow-circle-down" aria-hidden="true"></i>Download</a>
<a href="https://github.com/Shopify/liquid" target="_blank" class="btn"><i class="icon fa fa-2x fa-github" aria-hidden="true"></i>View on GitHub</a>
<a href="https://github.com/Shopify/liquid/archive/master.zip" target="_blank" class="btn">
<span aria-hidden="true">{% include icons/desktop-download.svg %}</span> Download
</a>
<a href="https://github.com/Shopify/liquid" target="_blank" class="btn">
<span aria-hidden="true">{% include icons/mark-github.svg %}</span> View on GitHub
</a>
</p>
</div>

View File

@@ -21,4 +21,4 @@
</div>
</div>
<p class="home-users-blurb">...and <a href="https://github.com/Shopify/liquid/wiki#who-uses-liquid" target="_blank">many more!</a></p>
<p class="home-users-blurb">...and <a href="https://github.com/Shopify/liquid/wiki#who-uses-liquid" target="_blank">many more</a></p>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 40.3 (33839) - http://www.bohemiancoding.com/sketch -->
<title>desktop-download</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Octicons" stroke="none" stroke-width="1" fill-rule="evenodd">
<g id="desktop-download">
<path d="M4,6 L7,6 L7,0 L9,0 L9,6 L12,6 L8,10 L4,6 L4,6 Z M15,2 L11,2 L11,3 L15,3 L15,11 L1,11 L1,3 L5,3 L5,2 L1,2 C0.45,2 0,2.45 0,3 L0,12 C0,12.55 0.45,13 1,13 L6.34,13 C6.09,13.61 5.48,14.39 4,15 L12,15 C10.52,14.39 9.91,13.61 9.66,13 L15,13 C15.55,13 16,12.55 16,12 L16,3 C16,2.45 15.55,2 15,2 L15,2 Z" id="Shape"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 833 B

12
_includes/icons/mark-github.svg Executable file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 40.3 (33839) - http://www.bohemiancoding.com/sketch -->
<title>mark-github</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Octicons" stroke="none" stroke-width="1" fill-rule="evenodd">
<g id="mark-github">
<path d="M8,0 C3.58,0 0,3.58 0,8 C0,11.54 2.29,14.53 5.47,15.59 C5.87,15.66 6.02,15.42 6.02,15.21 C6.02,15.02 6.01,14.39 6.01,13.72 C4,14.09 3.48,13.23 3.32,12.78 C3.23,12.55 2.84,11.84 2.5,11.65 C2.22,11.5 1.82,11.13 2.49,11.12 C3.12,11.11 3.57,11.7 3.72,11.94 C4.44,13.15 5.59,12.81 6.05,12.6 C6.12,12.08 6.33,11.73 6.56,11.53 C4.78,11.33 2.92,10.64 2.92,7.58 C2.92,6.71 3.23,5.99 3.74,5.43 C3.66,5.23 3.38,4.41 3.82,3.31 C3.82,3.31 4.49,3.1 6.02,4.13 C6.66,3.95 7.34,3.86 8.02,3.86 C8.7,3.86 9.38,3.95 10.02,4.13 C11.55,3.09 12.22,3.31 12.22,3.31 C12.66,4.41 12.38,5.23 12.3,5.43 C12.81,5.99 13.12,6.7 13.12,7.58 C13.12,10.65 11.25,11.33 9.47,11.53 C9.76,11.78 10.01,12.26 10.01,13.01 C10.01,14.08 10,14.94 10,15.21 C10,15.42 10.15,15.67 10.55,15.59 C13.71,14.53 16,11.53 16,8 C16,3.58 12.42,0 8,0 L8,0 Z" id="Shape"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

12
_includes/icons/three-bars.svg Executable file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="12px" height="16px" viewBox="0 0 12 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 40.3 (33839) - http://www.bohemiancoding.com/sketch -->
<title>three-bars</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Octicons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="three-bars" fill="#000000">
<path d="M11.41,9 L0.59,9 C0,9 0,8.59 0,8 C0,7.41 0,7 0.59,7 L11.4,7 C11.99,7 11.99,7.41 11.99,8 C11.99,8.59 11.99,9 11.4,9 L11.41,9 Z M11.41,5 L0.59,5 C0,5 0,4.59 0,4 C0,3.41 0,3 0.59,3 L11.4,3 C11.99,3 11.99,3.41 11.99,4 C11.99,4.59 11.99,5 11.4,5 L11.41,5 Z M0.59,11 L11.4,11 C11.99,11 11.99,11.41 11.99,12 C11.99,12.59 11.99,13 11.4,13 L0.59,13 C0,13 0,12.59 0,12 C0,11.41 0,11 0.59,11 L0.59,11 Z" id="Shape"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 942 B

View File

@@ -1,17 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{% if page.title %}{{ page.title }} {% endif %}{{ site.title }}</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
<meta name="description" content="{{ page.description | default: site.description }}">
<meta name="author" content="Shopify">
<meta name="robots" content="index, follow">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<link rel="stylesheet" href="{{ '/css/main.css' | prepend: site.baseurl }}">
<link href='//fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<link rel="canonical" href="{{ page.url | replace: 'index.html','' | prepend: site.baseurl | prepend: site.url }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
</head>
@@ -23,7 +28,7 @@
<main class="content__area" role="main">
<div class="content">
<button class="menu-button">
<i class="icon fa fa-2x fa-bars" aria-hidden="true"></i>
<span aria-hidden="true">{% include icons/three-bars.svg %}</span>
<span>Menu</span>
</button>
<h1>{{ page.title }}</h1>

View File

@@ -61,12 +61,6 @@ li {
}
}
/** Headings */
h1, h2, h3, h4, h5, h6 {
font-weight: bold;
}
/** Links */
a {
color: $color-blue-5;
@@ -80,19 +74,22 @@ a {
}
}
/** Headings */
h1 {
font-size: 2em;
font-weight: 300;
}
h2 {
font-size: 1.5em;
text-decoration: underline;
font-weight: 300;
margin-top: $spacing-unit;
}
h3 {
margin-top: $spacing-unit;
font-size: 1em;
text-decoration: underline;
}
h4 {
@@ -112,6 +109,7 @@ blockquote {
}
pre, code {
font-family: Menlo, Monaco, monospace;
font-size: 15px;
border-radius: 3px;
background-color: lighten($color-blue-1, 0.9);

View File

@@ -1,5 +1,6 @@
.btn {
color: $color-white;
fill: currentColor;
display: flex;
background: $color-blue-5;
align-items: center;
@@ -28,6 +29,14 @@
margin-bottom: 0;
}
}
svg {
margin-right: $spacing-unit / 4;
width: $base-font-size * 1.5;
height: $base-font-size * 1.5;
vertical-align: middle;
}
}
.btn:visited {
@@ -49,12 +58,6 @@
}
}
.icon {
vertical-align: middle;
margin-right: $spacing-unit / 4;
}
/*============================================================================
Menu button
==============================================================================*/
@@ -69,4 +72,12 @@
@include tablet-and-up {
display: none;
}
svg {
margin-right: $spacing-unit / 4;
width: $base-font-size * 1.2;
height: $base-font-size * 1.2;
vertical-align: middle;
}
}

View File

@@ -2,14 +2,23 @@
text-align: center;
border-bottom: 1px solid lighten($color-slate, 50%);
padding-bottom: $spacing-unit;
margin-bottom: $spacing-unit;
h1 {
font-weight: bold;
// font-weight: bold;
font-size: 4em;
&:after {
content: '💧';
vertical-align: middle;
}
@include phone-and-up {
font-size: 5em;
}
}
}
p {
color: lighten($color-slate, 20%);
}
}

View File

@@ -70,13 +70,18 @@ body {
.sidebar__logo {
font-size: $base-font-size * 2;
font-weight: bold;
font-weight: 300;
text-align: center;
height: $logo-height;
line-height: $logo-height;
margin-bottom: 0;
border-bottom: 1px solid $color-blue-4;
&:after {
content: '💧';
vertical-align: middle;
}
a {
color: $color-white;
text-decoration: none;
@@ -119,10 +124,10 @@ body {
}
.section__header {
font-weight: bold;
font-size: 1em;
text-decoration: none;
color: $color-white;
margin-top: 0;
margin-bottom: $spacing-unit / 4;
}

View File

@@ -1,6 +1,5 @@
$base-font-family: 'Droid Sans', sans-serif;
$base-font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif;
$base-font-size: 18px;
$small-font-size: $base-font-size * 0.875;
$base-line-height: 1.5;
$spacing-unit: 40px;

3
basics/index.md Normal file
View File

@@ -0,0 +1,3 @@
---
redirect_to: /liquid/basics/introduction
---

View File

@@ -1,7 +1,5 @@
---
title: Introduction
redirect_from:
- /basics/
---
Liquid code can be categorized into [**objects**](#objects), [**tags**](#tags), and [**filters**](#filters).

View File

@@ -1,5 +1,6 @@
---
title: abs
description: Liquid filter that gets the absolute value of a number.
---
Returns the absolute value of a number.

View File

@@ -1,5 +1,6 @@
---
title: append
description: Liquid filter that appends a string to another string.
---
Concatenates two strings and returns the concatenated value.

View File

@@ -1,5 +1,6 @@
---
title: capitalize
description: Liquid filter that capitalizes the first character in a string.
---
Makes the first character of a string capitalized.

View File

@@ -1,5 +1,6 @@
---
title: ceil
description: Liquid filter that gets the ceiling of a number by rounding up to the nearest integer.
---
Rounds the input up to the nearest whole number. Liquid tries to convert the input to a number before the filter is applied.

View File

@@ -1,5 +1,6 @@
---
title: date
description: Liquid filter that prints and formats dates.
---
Converts a timestamp into another date format. The format for this syntax is the same as [`strftime`](http://strftime.net).

View File

@@ -1,5 +1,6 @@
---
title: default
description: Liquid filter that specifies a fallback in case a value doesn't exist.
---
Allows you to specify a fallback in case a value doesn't exist. `default` will show its value if the left side is `nil`, `false`, or empty.

View File

@@ -1,5 +1,6 @@
---
title: divided_by
description: Liquid filter that divides a number by another number.
---
Divides a number by the specified number.

View File

@@ -1,5 +1,6 @@
---
title: downcase
description: Liquid filter that coverts a string to lowercase.
---
Makes each character in a string lowercase. It has no effect on strings which are already all lowercase.

View File

@@ -1,5 +1,6 @@
---
title: escape
description: Liquid filter that escapes URL-unsafe characters in a string.
---
Escapes a string by replacing characters with escape sequences (so that the string can be used in a URL, for example). It doesn't change strings that don't have anything to escape.

View File

@@ -1,5 +1,6 @@
---
title: escape_once
description: Liquid filter that escapes URL-unsafe characters in a string once.
---
Escapes a string without changing existing escaped entities. It doesn't change strings that don't have anything to escape.

View File

@@ -1,5 +1,6 @@
---
title: first
description: Liquid filter that returns the first item of an array.
---
Returns the first item of an array.

View File

@@ -1,5 +1,6 @@
---
title: floor
description: Liquid filter that gets the floor of a number by rounding down to the nearest integer.
---
Rounds a number down to the nearest whole number. Liquid tries to convert the input to a number before the filter is applied.

View File

@@ -1,14 +1,3 @@
---
title: Filters
type: index
redirect_to: /liquid/filters/abs
---
**Filters** change the output of a Liquid object. You can append one or more filters to an object by separating the filter and its parameters by a pipe symbol `|`.
{% assign filter_pages = site.pages | where: 'type', 'filter' %}
{% for item in filter_pages %}
## [{{ item.title }}]({{ item.url | prepend: site.baseurl }})
{{ item.content }}
{% endfor %}

View File

@@ -1,5 +1,6 @@
---
title: join
description: Liquid filter that joins an array of strings into a single string.
---
Combines the items in an array into a single string using the argument as a separator.

View File

@@ -1,5 +1,6 @@
---
title: last
description: Liquid filter that gets the last value in an array.
---
Returns the last item of an array.

View File

@@ -1,5 +1,6 @@
---
title: lstrip
description: Liquid filter that removes whitespace from the left side of a string.
---
Removes all whitespaces (tabs, spaces, and newlines) from the beginning of a string. The filter does not affect spaces between words.

View File

@@ -1,5 +1,6 @@
---
title: map
description: Liquid filter that creates an array of values by extracting a named property from an object.
---
Creates an array of values by extracting the values of a named property from another object.

View File

@@ -1,5 +1,6 @@
---
title: minus
description: Liquid filter that subtracts one number from another.
---
Subtracts a number from another number.

View File

@@ -1,5 +1,6 @@
---
title: modulo
description: Liquid filter that returns the remainder from a division operation.
---
Returns the remainder of a division operation.

View File

@@ -1,5 +1,6 @@
---
title: newline_to_br
description: Liquid filter that converts newlines in an input string to HTML <br> tags.
---
Replaces every newline (`\n`) with an HTML line break (`<br>`).

View File

@@ -1,5 +1,6 @@
---
title: plus
description: Liquid filter that adds a number to another number.
---
Adds a number to another number.

View File

@@ -1,5 +1,6 @@
---
title: prepend
description: Liquid filter that prepends a string to the beginning of another string.
---
Adds the specified string to the beginning of another string.

View File

@@ -1,5 +1,6 @@
---
title: remove
description: Liquid filter that removes all occurences of a given substring from a string.
---
Removes every occurrence of the specified substring from a string.

View File

@@ -1,5 +1,6 @@
---
title: remove_first
description: Liquid filter that removes the first occurence of a given substring from a string.
---
Removes only the first occurrence of the specified substring from a string.

View File

@@ -1,5 +1,6 @@
---
title: replace
description: Liquid filter that replaces all occurences of a given substring in a string.
---
Replaces every occurrence of an argument in a string with the second argument.

View File

@@ -1,5 +1,6 @@
---
title: replace_first
description: Liquid filter that replaces the first occurrence of a given substring in a string.
---
Replaces only the first occurrence of the first argument in a string with the second argument.

View File

@@ -1,5 +1,6 @@
---
title: reverse
description: Liquid filter that reverses an array, or a string converted to an array.
---
Reverses the order of the items in an array. `reverse` cannot reverse a string.

View File

@@ -1,5 +1,6 @@
---
title: round
description: Liquid filter that rounds a number to the nearest integer.
---
Rounds an input number to the nearest integer or, if a number is specified as an argument, to that number of decimal places.

View File

@@ -1,5 +1,6 @@
---
title: rstrip
description: Liquid filter that removes all whitespace from the right side of a string.
---
Removes all whitespace (tabs, spaces, and newlines) from the right side of a string.

View File

@@ -1,5 +1,6 @@
---
title: size
description: Liquid filter that returns the number of characters in a string or the number of items in an array.
---
Returns the number of characters in a string or the number of items in an array. `size` can also be used with dot notation (for example, `{% raw %}{{ my_string.size }}{% endraw %}`). This allows you to use `size` inside tags such as conditionals.

View File

@@ -1,5 +1,6 @@
---
title: slice
description: Liquid filter that returns a substring from a given position in a string.
---
Returns a substring of 1 character beginning at the index specified by the argument passed in. An optional second argument specifies the length of the substring to be returned.

View File

@@ -1,5 +1,6 @@
---
title: sort
description: Liquid filter that sorts an array in case-sensitive order.
---
Sorts items in an array by a property of an item in the array. The order of the sorted array is case-sensitive.

20
filters/sort_natural.md Normal file
View File

@@ -0,0 +1,20 @@
---
title: sort_natural
description: Liquid filter that sorts an array in case-insensitive order.
---
Sorts items in an array by a property of an item in the array.
<p class="code-label">Input</p>
```liquid
{% raw %}
{% assign my_array = "zebra, octopus, giraffe, Sally Snake" | split: ", " %}
{{ my_array | sort_natural | join: ", " }}
{% endraw %}
```
<p class="code-label">Output</p>
```text
giraffe, octopus, Sally Snake, zebra
```

View File

@@ -1,5 +1,6 @@
---
title: split
description: Liquid filter that splits a string into an array using separators.
---
Divides an input string into an array using the argument as a separator. `split` is commonly used to convert comma-separated items from a string to an array.

View File

@@ -1,5 +1,6 @@
---
title: strip
description: Liquid filter that removes whitespace from the left and right sides of a string.
---
Removes all whitespace (tabs, spaces, and newlines) from both the left and right side of a string. It does not affect spaces between words.

View File

@@ -1,5 +1,6 @@
---
title: strip_html
description: Liquid filter that removes HTML tags from a string.
---
Removes any HTML tags from a string.

View File

@@ -1,5 +1,6 @@
---
title: strip_newlines
description: Liquid filter that removes newline characters from a string.
---
Removes any newline characters (line breaks) from a string.

View File

@@ -1,5 +1,6 @@
---
title: times
description: Liquid filter that multiplies a number by another number.
---
Multiplies a number by another number.

View File

@@ -1,5 +1,6 @@
---
title: truncate
description: Liquid filter that truncates a string to a given number of characters.
---
`truncate` shortens a string down to the number of characters passed as a parameter. If the number of characters specified is less than the length of the string, an ellipsis (...) is appended to the string and is included in the character count.

View File

@@ -1,5 +1,6 @@
---
title: truncatewords
description: Liquid filter that truncates a string to the given number of words.
---
Shortens a string down to the number of words passed as the argument. If the specified number of words is less than the number of words in the string, an ellipsis (...) is appended to the string.

View File

@@ -1,5 +1,6 @@
---
title: uniq
description: Liquid filter that removes duplicate items from an array.
---
Removes any duplicate elements in an array.

View File

@@ -1,5 +1,6 @@
---
title: upcase
description: Liquid filter that capitalizes every character in a string.
---
Makes each character in a string uppercase. It has no effect on strings which are already all uppercase.

18
filters/url_decode.md Normal file
View File

@@ -0,0 +1,18 @@
---
title: url_decode
description: Liquid filter that decodes percent-encoded characters in a string.
---
Decodes a string that has been encoded as a URL or by [`url_encode`]({{ '/filters/url_encode' | prepend: site.baseurl }}).
<p class="code-label">Input</p>
```liquid
{% raw %}
{{ "%27Stop%21%27+said+Fred" | url_decode }}
{% endraw %}
```
<p class="code-label">Output</p>
```text
'Stop!' said Fred
```

View File

@@ -1,5 +1,6 @@
---
title: url_encode
description: Liquid filter that encodes URL-unsafe characters in a string.
---
Converts any URL-unsafe characters in a string into percent-encoded characters.

View File

@@ -4,13 +4,10 @@ layout: default
{% include home-banner.html %}
## What is Liquid?
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 has been in production use since June 2006 and is now used by many other hosted web applications.
Liquid has been in production use at Shopify since 2006 and is now used by many other hosted web applications.
## Who uses Liquid?
## Used by
{% include home-users-grid.html %}

View File

@@ -4,30 +4,6 @@ title: Control flow
Control flow tags can change the information Liquid shows using programming logic.
## case/when
Creates a switch statement to compare a variable with different values. `case` initializes the switch statement, and `when` compares its values.
<p class="code-label">Input</p>
```liquid
{% 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 %}
```
<p class="code-label">Output</p>
```text
This is a cake
```
## if
Executes a block of code only if a certain condition is `true`.
@@ -96,3 +72,27 @@ Adds more conditions within an `if` or `unless` block.
```text
Hey Anonymous!
```
## case/when
Creates a switch statement to compare a variable with different values. `case` initializes the switch statement, and `when` compares its values.
<p class="code-label">Input</p>
```liquid
{% 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 %}
```
<p class="code-label">Output</p>
```text
This is a cake
```