mirror of
https://github.com/kemko/liquid.git
synced 2026-01-03 00:35:40 +03:00
Compare commits
72 Commits
autumn-cle
...
gh-pages-t
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52c5d6f272 | ||
|
|
3b7538566c | ||
|
|
01d1f08c6a | ||
|
|
1577b29127 | ||
|
|
58e6e416eb | ||
|
|
83ce52a5f1 | ||
|
|
ecfcbc3ed5 | ||
|
|
ca3a1bf995 | ||
|
|
061dabed98 | ||
|
|
d4159b6069 | ||
|
|
ecd707cb44 | ||
|
|
7a0afa372e | ||
|
|
1547da87a5 | ||
|
|
e0f4e8f232 | ||
|
|
f15825ac76 | ||
|
|
a79240a909 | ||
|
|
fbad7cf377 | ||
|
|
ea0bf2d30b | ||
|
|
d18fc08323 | ||
|
|
22cb0018a5 | ||
|
|
8845d1ada1 | ||
|
|
45e7d6b652 | ||
|
|
15c6d74646 | ||
|
|
d9a4a3d9d7 | ||
|
|
e9e3e306ee | ||
|
|
cea42bd165 | ||
|
|
725335bbc1 | ||
|
|
307c8befc5 | ||
|
|
aed39a43f5 | ||
|
|
a842b59246 | ||
|
|
b669229f69 | ||
|
|
b211fb67fb | ||
|
|
38a59f4c1d | ||
|
|
02364d1025 | ||
|
|
bed2727d60 | ||
|
|
ffb9206ef0 | ||
|
|
9ac8895a1b | ||
|
|
8959afe1a8 | ||
|
|
c17cf534db | ||
|
|
9f74627676 | ||
|
|
3b3be384df | ||
|
|
daeb5b1e67 | ||
|
|
8a6f25f3da | ||
|
|
c2878c24c6 | ||
|
|
16c38e37eb | ||
|
|
0589cf4aac | ||
|
|
aba49324c1 | ||
|
|
c4ae2e9012 | ||
|
|
7cdc482bc4 | ||
|
|
fbe0b39d85 | ||
|
|
ebf7f9232f | ||
|
|
a0b0c608c1 | ||
|
|
1db4219d2f | ||
|
|
8b6f4d2a45 | ||
|
|
cee4a2d7ae | ||
|
|
4bd5446a4e | ||
|
|
2f703b30db | ||
|
|
2f8d447d90 | ||
|
|
7ecc10b989 | ||
|
|
406b1813cf | ||
|
|
058dc2021d | ||
|
|
49a41a3f08 | ||
|
|
61848f980b | ||
|
|
962e312fdc | ||
|
|
4a6de520db | ||
|
|
9745bf309e | ||
|
|
2a847e52fa | ||
|
|
5953c07346 | ||
|
|
4ccfaa470d | ||
|
|
d1aa9a1fa1 | ||
|
|
bfca97f54d | ||
|
|
e79f0f364d |
19
.travis.yml
19
.travis.yml
@@ -1,4 +1,17 @@
|
||||
install: gem install github-pages
|
||||
script: jekyll build --trace
|
||||
sudo: false
|
||||
rvm: 2.1
|
||||
language: ruby
|
||||
cache: bundler
|
||||
rvm: 2.4
|
||||
|
||||
before_install:
|
||||
- gem update --system
|
||||
install: bundle install
|
||||
script: bundle exec jekyll build --trace
|
||||
|
||||
branches:
|
||||
only:
|
||||
- gh-pages
|
||||
|
||||
env:
|
||||
global:
|
||||
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
||||
|
||||
2
Gemfile
2
Gemfile
@@ -1,3 +1,3 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'github-pages', '>=100', group: :jekyll_plugins
|
||||
gem 'github-pages', '>=180', group: :jekyll_plugins
|
||||
|
||||
281
Gemfile.lock
281
Gemfile.lock
@@ -1,145 +1,248 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
activesupport (4.2.7)
|
||||
activesupport (4.2.10)
|
||||
i18n (~> 0.7)
|
||||
json (~> 1.7, >= 1.7.7)
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.3, >= 0.3.4)
|
||||
tzinfo (~> 1.1)
|
||||
addressable (2.4.0)
|
||||
addressable (2.5.2)
|
||||
public_suffix (>= 2.0.2, < 4.0)
|
||||
coffee-script (2.4.1)
|
||||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.10.0)
|
||||
coffee-script-source (1.11.1)
|
||||
colorator (1.1.0)
|
||||
ethon (0.9.1)
|
||||
commonmarker (0.17.13)
|
||||
ruby-enum (~> 0.5)
|
||||
concurrent-ruby (1.0.5)
|
||||
dnsruby (1.61.2)
|
||||
addressable (~> 2.5)
|
||||
em-websocket (0.5.1)
|
||||
eventmachine (>= 0.12.9)
|
||||
http_parser.rb (~> 0.6.0)
|
||||
ethon (0.11.0)
|
||||
ffi (>= 1.3.0)
|
||||
eventmachine (1.2.7)
|
||||
execjs (2.7.0)
|
||||
faraday (0.9.2)
|
||||
faraday (0.15.3)
|
||||
multipart-post (>= 1.2, < 3)
|
||||
ffi (1.9.14)
|
||||
ffi (1.9.25)
|
||||
forwardable-extended (2.6.0)
|
||||
gemoji (2.1.0)
|
||||
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.8.0)
|
||||
jekyll-gist (= 1.4.0)
|
||||
jekyll-github-metadata (= 2.2.0)
|
||||
jekyll-mentions (= 1.2.0)
|
||||
gemoji (3.0.0)
|
||||
github-pages (192)
|
||||
activesupport (= 4.2.10)
|
||||
github-pages-health-check (= 1.8.1)
|
||||
jekyll (= 3.7.4)
|
||||
jekyll-avatar (= 0.6.0)
|
||||
jekyll-coffeescript (= 1.1.1)
|
||||
jekyll-commonmark-ghpages (= 0.1.5)
|
||||
jekyll-default-layout (= 0.1.4)
|
||||
jekyll-feed (= 0.10.0)
|
||||
jekyll-gist (= 1.5.0)
|
||||
jekyll-github-metadata (= 2.9.4)
|
||||
jekyll-mentions (= 1.4.1)
|
||||
jekyll-optional-front-matter (= 0.3.0)
|
||||
jekyll-paginate (= 1.1.0)
|
||||
jekyll-redirect-from (= 0.11.0)
|
||||
jekyll-sass-converter (= 1.3.0)
|
||||
jekyll-seo-tag (= 2.1.0)
|
||||
jekyll-sitemap (= 0.12.0)
|
||||
jekyll-readme-index (= 0.2.0)
|
||||
jekyll-redirect-from (= 0.14.0)
|
||||
jekyll-relative-links (= 0.5.3)
|
||||
jekyll-remote-theme (= 0.3.1)
|
||||
jekyll-sass-converter (= 1.5.2)
|
||||
jekyll-seo-tag (= 2.5.0)
|
||||
jekyll-sitemap (= 1.2.0)
|
||||
jekyll-swiss (= 0.4.0)
|
||||
jemoji (= 0.7.0)
|
||||
kramdown (= 1.11.1)
|
||||
liquid (= 3.0.6)
|
||||
listen (= 3.0.6)
|
||||
jekyll-theme-architect (= 0.1.1)
|
||||
jekyll-theme-cayman (= 0.1.1)
|
||||
jekyll-theme-dinky (= 0.1.1)
|
||||
jekyll-theme-hacker (= 0.1.1)
|
||||
jekyll-theme-leap-day (= 0.1.1)
|
||||
jekyll-theme-merlot (= 0.1.1)
|
||||
jekyll-theme-midnight (= 0.1.1)
|
||||
jekyll-theme-minimal (= 0.1.1)
|
||||
jekyll-theme-modernist (= 0.1.1)
|
||||
jekyll-theme-primer (= 0.5.3)
|
||||
jekyll-theme-slate (= 0.1.1)
|
||||
jekyll-theme-tactile (= 0.1.1)
|
||||
jekyll-theme-time-machine (= 0.1.1)
|
||||
jekyll-titles-from-headings (= 0.5.1)
|
||||
jemoji (= 0.10.1)
|
||||
kramdown (= 1.17.0)
|
||||
liquid (= 4.0.0)
|
||||
listen (= 3.1.5)
|
||||
mercenary (~> 0.3)
|
||||
minima (= 2.0.0)
|
||||
rouge (= 1.11.1)
|
||||
minima (= 2.5.0)
|
||||
nokogiri (>= 1.8.2, < 2.0)
|
||||
rouge (= 2.2.1)
|
||||
terminal-table (~> 1.4)
|
||||
github-pages-health-check (1.2.0)
|
||||
github-pages-health-check (1.8.1)
|
||||
addressable (~> 2.3)
|
||||
net-dns (~> 0.8)
|
||||
dnsruby (~> 1.60)
|
||||
octokit (~> 4.0)
|
||||
public_suffix (~> 1.4)
|
||||
typhoeus (~> 0.7)
|
||||
html-pipeline (2.4.2)
|
||||
public_suffix (~> 2.0)
|
||||
typhoeus (~> 1.3)
|
||||
html-pipeline (2.8.4)
|
||||
activesupport (>= 2)
|
||||
nokogiri (>= 1.4)
|
||||
i18n (0.7.0)
|
||||
jekyll (3.3.0)
|
||||
http_parser.rb (0.6.0)
|
||||
i18n (0.9.5)
|
||||
concurrent-ruby (~> 1.0)
|
||||
jekyll (3.7.4)
|
||||
addressable (~> 2.4)
|
||||
colorator (~> 1.0)
|
||||
em-websocket (~> 0.5)
|
||||
i18n (~> 0.7)
|
||||
jekyll-sass-converter (~> 1.0)
|
||||
jekyll-watch (~> 1.1)
|
||||
kramdown (~> 1.3)
|
||||
liquid (~> 3.0)
|
||||
jekyll-watch (~> 2.0)
|
||||
kramdown (~> 1.14)
|
||||
liquid (~> 4.0)
|
||||
mercenary (~> 0.3.3)
|
||||
pathutil (~> 0.9)
|
||||
rouge (~> 1.7)
|
||||
rouge (>= 1.7, < 4)
|
||||
safe_yaml (~> 1.0)
|
||||
jekyll-avatar (0.4.2)
|
||||
jekyll-avatar (0.6.0)
|
||||
jekyll (~> 3.0)
|
||||
jekyll-coffeescript (1.0.1)
|
||||
jekyll-coffeescript (1.1.1)
|
||||
coffee-script (~> 2.2)
|
||||
jekyll-feed (0.8.0)
|
||||
coffee-script-source (~> 1.11.1)
|
||||
jekyll-commonmark (1.2.0)
|
||||
commonmarker (~> 0.14)
|
||||
jekyll (>= 3.0, < 4.0)
|
||||
jekyll-commonmark-ghpages (0.1.5)
|
||||
commonmarker (~> 0.17.6)
|
||||
jekyll-commonmark (~> 1)
|
||||
rouge (~> 2)
|
||||
jekyll-default-layout (0.1.4)
|
||||
jekyll (~> 3.0)
|
||||
jekyll-feed (0.10.0)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-gist (1.4.0)
|
||||
jekyll-gist (1.5.0)
|
||||
octokit (~> 4.2)
|
||||
jekyll-github-metadata (2.2.0)
|
||||
jekyll-github-metadata (2.9.4)
|
||||
jekyll (~> 3.1)
|
||||
octokit (~> 4.0, != 4.4.0)
|
||||
jekyll-mentions (1.2.0)
|
||||
activesupport (~> 4.0)
|
||||
jekyll-mentions (1.4.1)
|
||||
html-pipeline (~> 2.3)
|
||||
jekyll (~> 3.0)
|
||||
jekyll-optional-front-matter (0.3.0)
|
||||
jekyll (~> 3.0)
|
||||
jekyll-paginate (1.1.0)
|
||||
jekyll-redirect-from (0.11.0)
|
||||
jekyll (>= 2.0)
|
||||
jekyll-sass-converter (1.3.0)
|
||||
sass (~> 3.2)
|
||||
jekyll-seo-tag (2.1.0)
|
||||
jekyll-readme-index (0.2.0)
|
||||
jekyll (~> 3.0)
|
||||
jekyll-redirect-from (0.14.0)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-sitemap (0.12.0)
|
||||
jekyll-relative-links (0.5.3)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-remote-theme (0.3.1)
|
||||
jekyll (~> 3.5)
|
||||
rubyzip (>= 1.2.1, < 3.0)
|
||||
jekyll-sass-converter (1.5.2)
|
||||
sass (~> 3.4)
|
||||
jekyll-seo-tag (2.5.0)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-sitemap (1.2.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)
|
||||
jekyll-theme-architect (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-cayman (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-dinky (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-hacker (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-leap-day (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-merlot (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-midnight (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-minimal (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-modernist (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-primer (0.5.3)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-github-metadata (~> 2.9)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-slate (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-tactile (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-theme-time-machine (0.1.1)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-seo-tag (~> 2.0)
|
||||
jekyll-titles-from-headings (0.5.1)
|
||||
jekyll (~> 3.3)
|
||||
jekyll-watch (2.0.0)
|
||||
listen (~> 3.0)
|
||||
jemoji (0.10.1)
|
||||
gemoji (~> 3.0)
|
||||
html-pipeline (~> 2.2)
|
||||
jekyll (>= 3.0)
|
||||
json (1.8.3)
|
||||
kramdown (1.11.1)
|
||||
liquid (3.0.6)
|
||||
listen (3.0.6)
|
||||
rb-fsevent (>= 0.9.3)
|
||||
rb-inotify (>= 0.9.7)
|
||||
jekyll (~> 3.0)
|
||||
kramdown (1.17.0)
|
||||
liquid (4.0.0)
|
||||
listen (3.1.5)
|
||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||
rb-inotify (~> 0.9, >= 0.9.7)
|
||||
ruby_dep (~> 1.2)
|
||||
mercenary (0.3.6)
|
||||
mini_portile2 (2.1.0)
|
||||
minima (2.0.0)
|
||||
minitest (5.9.1)
|
||||
mini_portile2 (2.3.0)
|
||||
minima (2.5.0)
|
||||
jekyll (~> 3.5)
|
||||
jekyll-feed (~> 0.9)
|
||||
jekyll-seo-tag (~> 2.1)
|
||||
minitest (5.11.3)
|
||||
multipart-post (2.0.0)
|
||||
net-dns (0.8.0)
|
||||
nokogiri (1.6.8.1)
|
||||
mini_portile2 (~> 2.1.0)
|
||||
octokit (4.6.0)
|
||||
nokogiri (1.8.4)
|
||||
mini_portile2 (~> 2.3.0)
|
||||
octokit (4.12.0)
|
||||
sawyer (~> 0.8.0, >= 0.5.3)
|
||||
pathutil (0.14.0)
|
||||
pathutil (0.16.1)
|
||||
forwardable-extended (~> 2.6)
|
||||
public_suffix (1.5.3)
|
||||
rb-fsevent (0.9.8)
|
||||
rb-inotify (0.9.7)
|
||||
ffi (>= 0.5.0)
|
||||
rouge (1.11.1)
|
||||
public_suffix (2.0.5)
|
||||
rb-fsevent (0.10.3)
|
||||
rb-inotify (0.9.10)
|
||||
ffi (>= 0.5.0, < 2)
|
||||
rouge (2.2.1)
|
||||
ruby-enum (0.7.2)
|
||||
i18n
|
||||
ruby_dep (1.5.0)
|
||||
rubyzip (1.2.2)
|
||||
safe_yaml (1.0.4)
|
||||
sass (3.4.22)
|
||||
sawyer (0.8.0)
|
||||
sass (3.6.0)
|
||||
sass-listen (~> 4.0.0)
|
||||
sass-listen (4.0.0)
|
||||
rb-fsevent (~> 0.9, >= 0.9.4)
|
||||
rb-inotify (~> 0.9, >= 0.9.7)
|
||||
sawyer (0.8.1)
|
||||
addressable (>= 2.3.5, < 2.6)
|
||||
faraday (~> 0.8, < 0.10)
|
||||
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)
|
||||
faraday (~> 0.8, < 1.0)
|
||||
terminal-table (1.8.0)
|
||||
unicode-display_width (~> 1.1, >= 1.1.1)
|
||||
thread_safe (0.3.6)
|
||||
typhoeus (1.3.0)
|
||||
ethon (>= 0.9.0)
|
||||
tzinfo (1.2.5)
|
||||
thread_safe (~> 0.1)
|
||||
unicode-display_width (1.1.1)
|
||||
unicode-display_width (1.4.0)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
github-pages (>= 100)
|
||||
github-pages (>= 180)
|
||||
|
||||
BUNDLED WITH
|
||||
1.13.1
|
||||
1.16.5
|
||||
|
||||
30
Gruntfile.js
30
Gruntfile.js
@@ -1,6 +1,6 @@
|
||||
// Gruntfile
|
||||
module.exports = function(grunt) {
|
||||
require('load-grunt-tasks')(grunt);
|
||||
module.exports = function (grunt) {
|
||||
require('load-grunt-tasks')(grunt)
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
@@ -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']
|
||||
}
|
||||
},
|
||||
@@ -24,22 +24,22 @@ require('load-grunt-tasks')(grunt);
|
||||
sass: {
|
||||
dist: {
|
||||
options: {
|
||||
style: 'expanded',
|
||||
style: 'compact',
|
||||
sourcemap: 'none'
|
||||
},
|
||||
files: {
|
||||
'_site/css/main.css':'_sass/main.scss'
|
||||
'_site/css/main.css': '_sass/main.scss'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
shell: {
|
||||
jekyllServe: {
|
||||
command: 'jekyll serve --no-watch'
|
||||
command: 'bundle exec jekyll serve --no-watch'
|
||||
},
|
||||
|
||||
jekyllBuild: {
|
||||
command: 'jekyll build'
|
||||
command: 'bundle exec jekyll build'
|
||||
}
|
||||
},
|
||||
|
||||
@@ -47,7 +47,7 @@ require('load-grunt-tasks')(grunt);
|
||||
options: {
|
||||
map: true,
|
||||
processors: [
|
||||
require('autoprefixer-core')({browsers: 'last 2 versions'})
|
||||
require('autoprefixer')({browsers: 'last 2 versions'})
|
||||
]
|
||||
},
|
||||
dist: {
|
||||
@@ -61,12 +61,12 @@ require('load-grunt-tasks')(grunt);
|
||||
logConcurrentOutput: true
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-contrib-sass');
|
||||
grunt.loadNpmTasks('grunt-postcss');
|
||||
grunt.loadNpmTasks('grunt-concurrent');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch')
|
||||
grunt.loadNpmTasks('grunt-contrib-sass')
|
||||
grunt.loadNpmTasks('grunt-postcss')
|
||||
grunt.loadNpmTasks('grunt-concurrent')
|
||||
|
||||
grunt.registerTask('default', ['concurrent']);
|
||||
};
|
||||
grunt.registerTask('default', ['concurrent'])
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: Introduction
|
||||
description: An overview of objects, tags, and filters in the Liquid template language.
|
||||
redirect_from: /basics/
|
||||
---
|
||||
|
||||
Liquid code can be categorized into [**objects**](#objects), [**tags**](#tags), and [**filters**](#filters).
|
||||
@@ -68,3 +69,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!
|
||||
```
|
||||
@@ -87,3 +87,28 @@ You can use multiple operators in a tag:
|
||||
```
|
||||
|
||||
`contains` can only search strings. You cannot use it to check for an object in an array of objects.
|
||||
|
||||
## Order of operations
|
||||
|
||||
In tags with more than one `and` or `or` operator, operators are checked in order *from right to left*. You cannot change the order of operations using parentheses — parentheses are invalid characters in Liquid and will prevent your tags from working.
|
||||
|
||||
```liquid
|
||||
{% raw %}
|
||||
{% if true or false and false %}
|
||||
This evaluates to true, since the 'and' condition is checked first.
|
||||
{% endif %}
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
```liquid
|
||||
{% raw %}
|
||||
{% if true and false and false or true %}
|
||||
This evaluates to false, since the tags are checked like this:
|
||||
|
||||
true and (false and (false or true))
|
||||
true and (false and true)
|
||||
true and false
|
||||
false
|
||||
{% endif %}
|
||||
{% endraw %}
|
||||
```
|
||||
@@ -3,7 +3,7 @@ title: Types
|
||||
description: An overview of data types in the Liquid template language.
|
||||
---
|
||||
|
||||
Liquid objects can have one of six types:
|
||||
Liquid objects can have one of five types:
|
||||
|
||||
- [String](#string)
|
||||
- [Number](#number)
|
||||
@@ -11,7 +11,7 @@ This site documents the latest version of **Liquid** including betas and release
|
||||
|
||||
Shopify always uses the latest version of Liquid as a base, but Shopify adds a significant number of objects, tags, and filters to Liquid for use in merchants' stores. These include objects representing store, product, and customer information, and filters for displaying store data and manipulating storefront assets like product images.
|
||||
|
||||
Shopify's version of Liquid is documented in the [Shopify Help Center](https://help.shopify.com/themes/liquid). If you want to try out Shopify's version of Liquid, you can [start a free trial of Shopify](https://www.shopify.com/signup) or use a sandbox like [DropPen](http://droppen.org/).
|
||||
Shopify's version of Liquid is documented in the [Shopify Help Center](https://help.shopify.com/themes/liquid). If you want to try out Shopify's version of Liquid, you can create a development store through the [Shopify Partner Dashboard](https://help.shopify.com/en/partners/dashboard/development-stores).
|
||||
|
||||
## Jekyll
|
||||
|
||||
24
_config.yml
24
_config.yml
@@ -3,19 +3,31 @@ description: Liquid is a template language and accompanying rendering engine. It
|
||||
|
||||
# Build settings
|
||||
baseurl: /liquid # the subpath of your site, e.g. /blog/
|
||||
url: http://liquidmarkup.org # the base hostname & protocol for your site
|
||||
url: https://shopify.github.io # the base hostname & protocol for your site
|
||||
permalink: pretty
|
||||
exclude:
|
||||
- README.md
|
||||
- CNAME
|
||||
- Gemfile
|
||||
- Gemfile.lock
|
||||
- Gruntfile.js
|
||||
- package.json
|
||||
- package-lock.json
|
||||
- node_modules
|
||||
- vendor
|
||||
keep_files: ["css"]
|
||||
|
||||
# Collections
|
||||
collections:
|
||||
basics:
|
||||
output: true
|
||||
tags:
|
||||
output: true
|
||||
filters:
|
||||
output: true
|
||||
|
||||
# Plugins
|
||||
gems:
|
||||
plugins:
|
||||
- jekyll-redirect-from
|
||||
|
||||
# Front matter defaults
|
||||
@@ -24,11 +36,3 @@ defaults:
|
||||
path: "" # an empty string here means all files in the project
|
||||
values:
|
||||
layout: default
|
||||
- scope:
|
||||
path: "filters"
|
||||
values:
|
||||
type: filter
|
||||
- scope:
|
||||
path: "tags"
|
||||
values:
|
||||
type: tag
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: abs
|
||||
description: Liquid filter that gets the absolute value of a number.
|
||||
redirect_from: /filters/
|
||||
---
|
||||
|
||||
Returns the absolute value of a number.
|
||||
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
|
||||
```
|
||||
@@ -3,7 +3,7 @@ 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).
|
||||
Converts a timestamp into another date format. The format for this syntax is the same as [`strftime`](http://strftime.net). The input uses the same format as Ruby's [`Time.parse`](https://ruby-doc.org/stdlib/libdoc/time/rdoc/Time.html#method-c-parse).
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
```liquid
|
||||
@@ -36,3 +36,13 @@ Returns the first item of an array.
|
||||
|
||||
{{ my_array.first }}
|
||||
```
|
||||
|
||||
You can use `first` with dot notation when you need to use the filter inside a tag.
|
||||
|
||||
```liquid
|
||||
{% raw %}
|
||||
{% if my_array.first == "zebra" %}
|
||||
Here comes a zebra!
|
||||
{% endif %}
|
||||
{% endraw %}
|
||||
```
|
||||
@@ -36,3 +36,13 @@ Returns the last item of an array.
|
||||
|
||||
{{ my_array.last }}
|
||||
```
|
||||
|
||||
You can use `last` with dot notation when you need to use the filter inside a tag.
|
||||
|
||||
```liquid
|
||||
{% raw %}
|
||||
{% if my_array.last == "tiger" %}
|
||||
There goes a tiger!
|
||||
{% endif %}
|
||||
{% endraw %}
|
||||
```
|
||||
@@ -22,7 +22,7 @@ You can also `prepend` variables:
|
||||
<p class="code-label">Input</p>
|
||||
```liquid
|
||||
{% raw %}
|
||||
{% assign url = "liquidmarkup.com" %}
|
||||
{% assign url = "example.com" %}
|
||||
|
||||
{{ "/index.html" | prepend: url }}
|
||||
{% endraw %}
|
||||
@@ -30,7 +30,7 @@ You can also `prepend` variables:
|
||||
|
||||
<p class="code-label">Output</p>
|
||||
```text
|
||||
{% assign url = "liquidmarkup.com" %}
|
||||
{% assign url = "example.com" %}
|
||||
|
||||
{{ "/index.html" | prepend: url }}
|
||||
```
|
||||
@@ -3,7 +3,7 @@ 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.
|
||||
Returns the number of characters in a string or the number of items in an array.
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
```liquid
|
||||
@@ -33,7 +33,7 @@ Returns the number of characters in a string or the number of items in an array.
|
||||
{{ my_array | size }}
|
||||
```
|
||||
|
||||
Using dot notation:
|
||||
You can use `size` with dot notation when you need to use the filter inside a tag.
|
||||
|
||||
```liquid
|
||||
{% raw %}
|
||||
@@ -3,7 +3,7 @@ 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.
|
||||
Sorts items in an array in case-sensitive order.
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
```liquid
|
||||
@@ -20,3 +20,14 @@ Sorts items in an array by a property of an item in the array. The order of the
|
||||
|
||||
{{ my_array | sort | join: ", " }}
|
||||
```
|
||||
|
||||
An optional parameter specifies which property of the array's items to use for sorting.
|
||||
|
||||
```liquid
|
||||
{% raw %}
|
||||
{% assign products_by_price = collection.products | sort: "price" %}
|
||||
{% for product in products_by_price %}
|
||||
<h4>{{ product.title }}</h4>
|
||||
{% endfor %}
|
||||
{% endraw %}
|
||||
```
|
||||
33
_filters/sort_natural.md
Normal file
33
_filters/sort_natural.md
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
title: sort_natural
|
||||
description: Liquid filter that sorts an array in case-insensitive order.
|
||||
---
|
||||
|
||||
Sorts items in an array in case-insensitive order.
|
||||
|
||||
<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
|
||||
{% assign my_array = "zebra, octopus, giraffe, Sally Snake" | split: ", " %}
|
||||
|
||||
{{ my_array | sort_natural | join: ", " }}
|
||||
```
|
||||
|
||||
An optional parameter specifies which property of the array's items to use for sorting.
|
||||
|
||||
```liquid
|
||||
{% raw %}
|
||||
{% assign products_by_company = collection.products | sort_natural: "company" %}
|
||||
{% for product in products_by_company %}
|
||||
<h4>{{ product.title }}</h4>
|
||||
{% endfor %}
|
||||
{% endraw %}
|
||||
```
|
||||
90
_filters/where.md
Normal file
90
_filters/where.md
Normal file
@@ -0,0 +1,90 @@
|
||||
---
|
||||
title: where
|
||||
description: Liquid filter that selects from arrays.
|
||||
---
|
||||
|
||||
Creates an array including only the objects with a given property value, or any [truthy]({{ "/basics/truthy-and-falsy#truthy" | prepend: site.baseurl }}) value by default.
|
||||
|
||||
In this example, assume you have a list of products and you want to show your kitchen products separately. Using `where`, you can create an array containing only the products that have a `"type"` of `"kitchen"`.
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
{% raw %}
|
||||
```liquid
|
||||
All products:
|
||||
{% for product in products %}
|
||||
- {{ product.title }}
|
||||
{% endfor %}
|
||||
|
||||
{% assign kitchen_products = products | where: "type", "kitchen" %}
|
||||
|
||||
Kitchen products:
|
||||
{% for product in kitchen_products %}
|
||||
- {{ product.title }}
|
||||
{% endfor %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
<p class="code-label">Output</p>
|
||||
```text
|
||||
All products:
|
||||
- Vacuum
|
||||
- Spatula
|
||||
- Television
|
||||
- Garlic press
|
||||
|
||||
Kitchen products:
|
||||
- Spatula
|
||||
- Garlic press
|
||||
|
||||
```
|
||||
|
||||
Say instead you have a list of products and you only want to show those that are available to buy. You can `where` with a property name but no target value to include all products with a [truthy]({{ "/basics/truthy-and-falsy#truthy" | prepend: site.baseurl }}) `"available"` value.
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
{% raw %}
|
||||
```liquid
|
||||
All products:
|
||||
{% for product in products %}
|
||||
- {{ product.title }}
|
||||
{% endfor %}
|
||||
|
||||
{% assign available_products = products | where: "available" %}
|
||||
|
||||
Available products:
|
||||
{% for product in available_products %}
|
||||
- {{ product.title }}
|
||||
{% endfor %}
|
||||
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
<p class="code-label">Output</p>
|
||||
|
||||
```text
|
||||
All products:
|
||||
- Coffee mug
|
||||
- Limited edition sneakers
|
||||
- Boring sneakers
|
||||
|
||||
Available products:
|
||||
- Coffee mug
|
||||
- Boring sneakers
|
||||
|
||||
```
|
||||
|
||||
|
||||
The `where` filter can also be used to find a single object in an array when combined with the `first` filter. For example, say you want to show off the shirt in your new fall collection.
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
{% raw %}
|
||||
```liquid
|
||||
{% assign new_shirt = products | where: "type", "shirt" | first %}
|
||||
|
||||
Featured product: {{ new_shirt.title }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
<p class="code-label">Output</p>
|
||||
```text
|
||||
Featured product: Hawaiian print sweater vest
|
||||
```
|
||||
@@ -1,22 +1,22 @@
|
||||
<div class="home-users-grid">
|
||||
<div class="home-users-grid__item">
|
||||
<a href="http://jekyllrb.com" target="_blank">
|
||||
<img src="{{ '/images/jekyll-logo.png' | prepend: site.baseurl }}" alt="Jekyll logo" />
|
||||
<img src="{{ '/images/jekyll-logo.png' | relative_url }}" alt="Jekyll logo" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="home-users-grid__item">
|
||||
<a href="http://www.desk.com" target="_blank">
|
||||
<img src="{{ '/images/salesforcedesk-logo.png' | prepend: site.baseurl }}" alt="Desk logo" />
|
||||
<img src="{{ '/images/salesforcedesk-logo.png' | relative_url }}" alt="Desk logo" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="home-users-grid__item">
|
||||
<a href="//www.zendesk.com" target="_blank">
|
||||
<img src="{{ '/images/zendesk-logo.png' | prepend: site.baseurl }}" alt="ZenDesk logo" />
|
||||
<img src="{{ '/images/zendesk-logo.png' | relative_url }}" alt="ZenDesk logo" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="home-users-grid__item">
|
||||
<a href="//500px.com" target="_blank">
|
||||
<img src="{{ '/images/500px-logo.png' | prepend: site.baseurl }}" alt="500px logo" />
|
||||
<img src="{{ '/images/500px-logo.png' | relative_url }}" alt="500px logo" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1 +1 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><title>desktop-download</title><desc>Created with Sketch.</desc><path d="M4 6h3v-6h2v6h3l-4 4-4-4zm11-4h-4v1h4v8h-14v-8h4v-1h-4c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h5.34c-.25.61-.86 1.39-2.34 2h8c-1.48-.61-2.09-1.39-2.34-2h5.34c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1z" fill-rule="evenodd"/></svg>
|
||||
<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m4 6h3v-6h2v6h3l-4 4zm11-4h-4v1h4v8h-14v-8h4v-1h-4c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h5.34c-.25.61-.86 1.39-2.34 2h8c-1.48-.61-2.09-1.39-2.34-2h5.34c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1z" fill-rule="evenodd"/></svg>
|
||||
|
Before Width: | Height: | Size: 372 B After Width: | Height: | Size: 304 B |
@@ -1 +1 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><title>mark-github</title><desc>Created with Sketch.</desc><path d="M8 0c-4.42 0-8 3.58-8 8 0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38l-.01-1.49c-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38 3.16-1.06 5.45-4.06 5.45-7.59 0-4.42-3.58-8-8-8z" fill-rule="evenodd"/></svg>
|
||||
<svg height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m8 0c-4.42 0-8 3.58-8 8 0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38l-.01-1.49c-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38 3.16-1.06 5.45-4.06 5.45-7.59 0-4.42-3.58-8-8-8z" fill-rule="evenodd"/></svg>
|
||||
|
Before Width: | Height: | Size: 746 B After Width: | Height: | Size: 682 B |
@@ -1 +1 @@
|
||||
<svg width="12" height="16" viewBox="0 0 12 16" xmlns="http://www.w3.org/2000/svg"><title>three-bars</title><desc>Created with Sketch.</desc><path d="M11.41 9h-10.82c-.59 0-.59-.41-.59-1 0-.59 0-1 .59-1h10.81c.59 0 .59.41.59 1 0 .59 0 1-.59 1h.01zm0-4h-10.82c-.59 0-.59-.41-.59-1 0-.59 0-1 .59-1h10.81c.59 0 .59.41.59 1 0 .59 0 1-.59 1h.01zm-10.82 6h10.81c.59 0 .59.41.59 1 0 .59 0 1-.59 1h-10.81c-.59 0-.59-.41-.59-1 0-.59 0-1 .59-1z" fill="#000"/></svg>
|
||||
<svg height="16" viewBox="0 0 12 16" width="12" xmlns="http://www.w3.org/2000/svg"><path d="m11.41 9h-10.82c-.59 0-.59-.41-.59-1s0-1 .59-1h10.81c.59 0 .59.41.59 1s0 1-.59 1zm0-4h-10.82c-.59 0-.59-.41-.59-1s0-1 .59-1h10.81c.59 0 .59.41.59 1s0 1-.59 1zm-10.82 6h10.81c.59 0 .59.41.59 1s0 1-.59 1h-10.81c-.59 0-.59-.41-.59-1s0-1 .59-1z"/></svg>
|
||||
|
Before Width: | Height: | Size: 455 B After Width: | Height: | Size: 341 B |
@@ -1,18 +1,33 @@
|
||||
<div class="sidebar">
|
||||
<header class="sidebar__logo" role="banner">
|
||||
<a href="{{ "/" | prepend: site.baseurl }}">Liquid</a>
|
||||
{% if page.home %}
|
||||
Liquid
|
||||
{% else %}
|
||||
<a href="{{ "/" | relative_url }}">Liquid</a>
|
||||
{% endif %}
|
||||
</header>
|
||||
<nav class="sidebar__nav"> {% assign sections = "basics, tags, filters" | split: ", " %}
|
||||
|
||||
{% for section in sections %}
|
||||
<h3 class="section__header">{{ section | capitalize }}</h3>
|
||||
{%- assign sections = "basics, tags, filters" | split: ", " -%}
|
||||
|
||||
<ul class="section__links">
|
||||
{% for item in site.pages %}{% if item.url contains section/ %}{% unless item.path contains "index" %}
|
||||
<li><a href="{{ item.url | prepend: site.baseurl }}" class="section__link{% if item.url contains page.url and page.url != '/' and page.type != 'index' %} section__link--is-active{% endif %}">{{ item.title }}</a></li>
|
||||
{% endunless %}{% endif %}{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}
|
||||
<nav class="sidebar__nav">
|
||||
<div class="sidebar__nav-interior">
|
||||
{%- for section in sections -%}
|
||||
<h3 class="section__header" id="{{ section }}">{{ section | capitalize }}</h3>
|
||||
|
||||
<ul class="section__links">
|
||||
{%- for item in site[section] -%}
|
||||
<li class="section__item">
|
||||
<a href="{{ item.url | relative_url }}" class="section__link{% if item.url == page.url %} section__link--is-active{% endif %}">{{ item.title }}</a>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
{%- endfor -%}
|
||||
</div>
|
||||
|
||||
{%- if sections contains page.collection -%}
|
||||
<script type="text/javascript">
|
||||
document.getElementById("{{ page.collection }}").scrollIntoView();
|
||||
</script>
|
||||
{%- endif -%}
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta charset="utf-8" />
|
||||
@@ -15,25 +15,33 @@
|
||||
<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 rel="icon" type="image/png" href="{{ '/images/icons/water-drop-32x.png' | prepend: site.baseurl }}" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="{{ '/images/icons/water-drop-64x.png' | prepend: site.baseurl }}" sizes="64x64">
|
||||
<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 }}" />
|
||||
<link rel="stylesheet" href="{{ '/css/main.css' | relative_url }}">
|
||||
<link rel="icon" type="image/png" href="{{ '/images/icons/water-drop-32x.png' | relative_url }}" sizes="32x32">
|
||||
<link rel="icon" type="image/png" href="{{ '/images/icons/water-drop-64x.png' | relative_url }}" sizes="64x64">
|
||||
<link rel="canonical" href="{{ page.url | replace: 'index.html','' | absolute_url }}">
|
||||
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | relative_url }}" />
|
||||
|
||||
<meta property="og:site_name" content="{{ site.title }}">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="{{ site.url | append: site.baseurl }}">
|
||||
<meta property="og:url" content="{{ page.url | relative_url }}">
|
||||
<meta property="og:title" content="{{ page.title | default: site.title }}">
|
||||
<meta property="og:description" content="{{ page.description | default: site.description }}">
|
||||
|
||||
<meta name="twitter:site" content="{{ site.title }}">
|
||||
<meta name="twitter:card" content="summary">
|
||||
<meta name="twitter:url" content="{{ site.url | append: site.baseurl }}">
|
||||
<meta name="twitter:url" content="{{ site.url | relative_url }}">
|
||||
<meta name="twitter:title" content="{{ page.title | default: site.title }}">
|
||||
<meta name="twitter:description" content="{{ page.description | default: site.description }}">
|
||||
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-49178120-52"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
<script src="{{ '/js/vendor/jquery-3.1.1.slim.min.js' | prepend: site.baseurl }}"></script>
|
||||
gtag('config', 'UA-49178120-52');
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -47,10 +55,10 @@
|
||||
<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>
|
||||
<script src="{{ '/js/script.js' | prepend: site.baseurl }}"></script>
|
||||
<script src="{{ '/js/script.js' | relative_url }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -123,6 +123,7 @@ pre {
|
||||
padding: 8px 12px;
|
||||
border: 1px solid $color-blue-2;
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
|
||||
> code {
|
||||
border: 0;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
$sidebar-width: 250px;
|
||||
$logo-height: 130px;
|
||||
$wrapper-width: 800px;
|
||||
@@ -69,13 +68,15 @@ body {
|
||||
}
|
||||
|
||||
.sidebar__logo {
|
||||
border-bottom: 1px solid $color-blue-4;
|
||||
color: $color-white;
|
||||
font-size: $base-font-size * 2;
|
||||
font-weight: 300;
|
||||
text-align: center;
|
||||
height: $logo-height;
|
||||
line-height: $logo-height;
|
||||
margin-bottom: 0;
|
||||
border-bottom: 1px solid $color-blue-4;
|
||||
text-align: center;
|
||||
|
||||
|
||||
// &:after {
|
||||
// content: '\01F4A7'; // Water droplet emoji
|
||||
@@ -93,34 +94,16 @@ body {
|
||||
}
|
||||
|
||||
.sidebar__nav {
|
||||
padding: $spacing-unit $spacing-unit ($spacing-unit + $logo-height); // Add a bit more padding at the bottom for consistency.
|
||||
|
||||
font-weight: bold;
|
||||
max-height: 100%;
|
||||
overflow-y: scroll;
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
|
||||
a {
|
||||
color: $color-white;
|
||||
|
||||
&:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.section {
|
||||
margin: 0px;
|
||||
|
||||
> li {
|
||||
margin-bottom: $spacing-unit / 2;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: $spacing-unit;
|
||||
}
|
||||
}
|
||||
.sidebar__nav-interior {
|
||||
height: 100%;
|
||||
// Add a bit more padding at the bottom for consistency.
|
||||
padding: $spacing-unit $spacing-unit ($spacing-unit + $logo-height);
|
||||
}
|
||||
|
||||
.section__header {
|
||||
@@ -129,13 +112,22 @@ body {
|
||||
color: $color-white;
|
||||
margin-top: 0;
|
||||
margin-bottom: $spacing-unit / 4;
|
||||
|
||||
.section__links + & {
|
||||
margin-top: $spacing-unit;
|
||||
}
|
||||
}
|
||||
|
||||
.section__links {
|
||||
margin-left: $spacing-unit / 2;
|
||||
margin-bottom: $spacing-unit;
|
||||
font-weight: normal;
|
||||
font-size: 0.9em;
|
||||
font-weight: normal;
|
||||
|
||||
list-style: none;
|
||||
margin-left: $spacing-unit / 2;
|
||||
}
|
||||
|
||||
.section__item {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.section__link {
|
||||
@@ -143,13 +135,26 @@ body {
|
||||
margin-top: $spacing-unit/4;
|
||||
opacity: 0.75;
|
||||
text-decoration: none;
|
||||
color: $color-white;
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
&:empty {
|
||||
// there is an error in the liquid logic that spits out a
|
||||
// empty last-child
|
||||
display: none;
|
||||
}
|
||||
|
||||
&:visited {
|
||||
color: $color-white;
|
||||
}
|
||||
}
|
||||
|
||||
.section__link--is-active {
|
||||
font-weight: bold;
|
||||
opacity: 1;
|
||||
color: $color-white;
|
||||
}
|
||||
|
||||
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.
|
||||
```
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: Control flow
|
||||
description: An overview of control flow and conditional tags in the Liquid template language.
|
||||
redirect_from: /tags/
|
||||
---
|
||||
|
||||
Control flow tags can change the information Liquid shows using programming logic.
|
||||
@@ -23,6 +23,26 @@ Repeatedly executes a block of code. For a full list of attributes available wit
|
||||
hat shirt pants
|
||||
```
|
||||
|
||||
### else
|
||||
|
||||
Specifies a fallback case for a `for` loop which will run if the loop has zero length.
|
||||
|
||||
<p class="code-label">Input</p>
|
||||
```liquid
|
||||
{% raw %}
|
||||
{% for product in collection.products %}
|
||||
{{ product.title }}
|
||||
{% else %}
|
||||
The collection is empty.
|
||||
{% endfor %}
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
<p class="code-label">Output</p>
|
||||
```text
|
||||
The collection is empty.
|
||||
```
|
||||
|
||||
### break
|
||||
|
||||
Causes the loop to stop iterating when it encounters the `break` tag.
|
||||
@@ -133,7 +153,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
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
redirect_to: /liquid/basics/introduction
|
||||
---
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
redirect_to: /liquid/filters/abs
|
||||
---
|
||||
@@ -1,20 +0,0 @@
|
||||
---
|
||||
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
|
||||
```
|
||||
1
index.md
1
index.md
@@ -1,5 +1,6 @@
|
||||
---
|
||||
layout: default
|
||||
home: true
|
||||
description: Documentation for the Liquid template language, created by Shopify.
|
||||
---
|
||||
|
||||
|
||||
21
js/script.js
21
js/script.js
@@ -1,12 +1,15 @@
|
||||
$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 () {
|
||||
menuButton.addEventListener('click', function () {
|
||||
sidebar.classList.toggle('sidebar--is-visible')
|
||||
contentOverlay.classList.toggle('content__overlay--is-active')
|
||||
})
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$menuButton.add($contentOverlay).on("click", function() {
|
||||
$sidebar.toggleClass("sidebar--is-visible");
|
||||
$contentOverlay.toggleClass("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
1542
package-lock.json
generated
Normal file
1542
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
21
package.json
21
package.json
@@ -1,16 +1,15 @@
|
||||
{
|
||||
"name": "liquid-docs",
|
||||
"version": "0.1.0",
|
||||
"version": "0.2.0",
|
||||
"devDependencies": {
|
||||
"autoprefixer-core": "^5.2.1",
|
||||
"grunt": "~0.4.1",
|
||||
"grunt-autoprefixer": "^3.0.3",
|
||||
"grunt-concurrent": "^1.0.0",
|
||||
"grunt-contrib-concat": "^0.5.1",
|
||||
"grunt-contrib-sass": "^0.9.2",
|
||||
"grunt-contrib-watch": "^0.6.1",
|
||||
"grunt-postcss": "^0.5.5",
|
||||
"grunt-shell": "^1.1.2",
|
||||
"load-grunt-tasks": "^3.1.0"
|
||||
"autoprefixer": "~8.2",
|
||||
"grunt": "~1.0.3",
|
||||
"grunt-concurrent": "~2.3",
|
||||
"grunt-contrib-concat": "~1.0",
|
||||
"grunt-contrib-sass": "~1.0",
|
||||
"grunt-contrib-watch": "~1.1.0",
|
||||
"grunt-postcss": "~0.9",
|
||||
"grunt-shell": "~2.1",
|
||||
"load-grunt-tasks": "~3.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
---
|
||||
redirect_to: /liquid/tags/control-flow
|
||||
---
|
||||
Reference in New Issue
Block a user