docs: add tutorials/options.md

This commit is contained in:
harttle
2020-03-29 22:10:52 +08:00
parent 9ebf11edcf
commit 983bcf467a
19 changed files with 259 additions and 37 deletions
+9 -1
View File
@@ -7,4 +7,12 @@ cd docs
npm ci
npm run build
cp CNAME public/
npm run index # env required: HEXO_ALGOLIA_INDEXING_KEY
cp ../CHANGELOG.md source/tutorials/changelog.md
sed -i '1i ---\ntitle: Changelog\n---\n' source/tutorials/changelog.md
cp ../CHANGELOG.md source/zh-cn/tutorials/changelog.md
sed -i '1i ---\ntitle: 更新日志\n---\n' source/zh-cn/tutorials/changelog.md
if [ "$HEXO_ALGOLIA_INDEXING_KEY" != "" ]; then
npm run index
fi
+2 -1
View File
@@ -3,4 +3,5 @@ source/api/
source/zh-cn/api/
.vuepress
db.json
public
public
changelog.md
+1 -1
View File
@@ -18,7 +18,7 @@
en: 'Memory Optimization: a more elaborate parser reducing the memory footprint by 57.7%.'
-
url: https://github.com/harttle/liquidjs/pull/205
date: '2016-09-15'
date: '2020-09-15'
title:
zh-cn: '性能提升:引入 AST 并重新设计 Token 类型系统,使渲染性能平均提升 100.3%。'
en: 'Performance Boost: a simple AST to improve render performance by 100.3%.'
+3 -1
View File
@@ -1,7 +1,8 @@
tutorials:
getting_started:
intro: intro-to-liquid.html
setup: setup.html
syntax: syntax.html
options: options.html
render_file: render-file.html
partials: partials-and-layouts.html
express: use-in-expressjs.html
@@ -14,6 +15,7 @@ tutorials:
truth: truthy-and-falsy.html
miscellaneous:
migration9: migrate-to-9.html
changelog: changelog.html
contribution_guidelines: contribution-guidelines.html
filters:
+8 -8
View File
@@ -8,22 +8,22 @@ ul#intro-feature-list
.intro-feature-icon
i.icon-shield
h3.intro-feature-title Safe Rendering
p.intro-feature-desc All outputs are automatically escaped for safe and customer facing HTML rendering. Operators and expressions are parsed to AST and no #[code eval] or #[code new Function] are used.
p.intro-feature-desc Liquid templates are highly readable and fault-tolerant thus suitable for designers and customers. Operators and expressions are parsed to AST and no #[code eval] or #[code new Function] are used.
li.intro-feature-wrap
.intro-feature
.intro-feature-icon
i.icon-javascript
h3.intro-feature-title Pure JavaScript
p.intro-feature-desc Written with zero npm dependencies and no native bindings, available for both Node.js and the browsers. All of the CMD, ESM and CJS bundles are available on CDN.
i.icon-rocket
h3.intro-feature-title Zero Dependency
p.intro-feature-desc Written with zero npm dependency and no native binding, available in both Node.js and browsers. All of the CMD, ESM and CJS bundles are available on CDN.
li.intro-feature-wrap
.intro-feature
.intro-feature-icon
i.icon-shopify
h3.intro-feature-title Shopify Compatible
p.intro-feature-desc Almost all features, filters and tags from Ruby #[a(href="https://github.com/shopify/liquid") shopify/liquid] are also supported by LiquidJS. #[a(href="https://jekyllrb.com/") Jekyll sites], #[a(href="https://pages.github.com/") Github Pages] and #[a(href="https://themes.shopify.com/") Shopify templates] can be ported to Node.js without pain.
p.intro-feature-desc All filters and tags from Ruby #[a(href="https://github.com/shopify/liquid") shopify/liquid] are supported by LiquidJS. #[a(href="https://jekyllrb.com/") Jekyll sites], #[a(href="https://pages.github.com/") Github Pages] and #[a(href="https://themes.shopify.com/") Shopify templates] can be ported to Node.js without pain.
li.intro-feature-wrap
.intro-feature
.intro-feature-icon
i.icon-cog
h3.intro-feature-title Extensibility
p.intro-feature-desc The whole repo is re-written in TypeScript strict mode to ensure the APIs are consistent and the documentation is always up to date. Apart from 60+ builtin tags and filters, LiquidJS provides APIs to register yours.
i.icon-typescript
h3.intro-feature-title TypeScript Strict
p.intro-feature-desc The whole repo is re-written in TypeScript strict mode to ensure a smooth experience using this lib and the document is precise and always up to date.
+99
View File
@@ -0,0 +1,99 @@
---
title: Options
---
The [Liquid][liquid] constructor accepts a plain object as options to define the behaviour of LiquidJS. All of these options are optional thus we can specify any of them, for example the `cache` option:
```javascript
const { Liquid } = require('liquidjs')
const engine = new Liquid({
cache: true
})
```
{% note info API Document %}
Following is an overview for all the options, for exact types and signatures please refer to <a href="https://liquidjs.com/api/interfaces/liquid_options_.liquidoptions.html" target="_self">LiquidOptions | API</a>.
{% endnote %}
## cache
**cache** is used to improve performance by caching previously parsed template structures, specially in cases when we're repeatedly parse or render files.
It's default to `false`. When setting to `true` a default LRU cache of size 1024 will be enabled. And certainly it can be a number which indicates the size of cache you want.
Additionally, it can also be a custom cache implementation. See [Caching][caching] for details.
## dynamicPartials
**dynamicPartials** indicates whether or not to treat filename arguments in [include][include], [render][render], [layout][layout] tags as a variable. Defaults to `true`. For example, render the following snippet with scope `{ file: 'foo.html' }` will include the `foo.html`:
```liquid
{% include file %}
```
Setting `dynamicPartials: false`, LiquidJS will try to include the file named `file`, which is weird but allows simpler syntax if your template relations are static:
```liquid
{% liquid foo.html %}
```
{% note warn Common Pitfall %}
LiquidJS defaults this option to <code>true</code> to be compatible with shopify/liquid, but if you're from <a href="https://github.com/11ty/eleventy" target="_blank">eleventy</a> it's set to <code>false</code> by default (see <a href="https://www.11ty.dev/docs/languages/liquid/#quoted-include-paths" target="_blank">Quoted Include Paths</a>) which I believe is trying to be compatible with Jekyll.{% endnote %}
## extname
**extname** defines the default extname to be appended into filenames if the filename has no extname. Defaults to `''` which means it's disabled by default. By setting it to `.liquid`:
```liquid
{% render "foo" %} loads foo.liquid
{% render "foo.html" %} loads foo.html
```
{% note info Legacy Versions %}
Before 2.0.1, <code>extname</code> is set to `.liquid` by default. To change that you need to set <code>extname: ''</code> explicitly. See <a href="https://github.com/harttle/liquidjs/issues/41" target="_blank">#41</a> for details.
{% endnote %}
## root
**root** is used to specify template directories for LiquidJS to lookup and read template files. Can be a single string and an array of strings. See [Render Files][render-file] for details.
## fs
**fs** is used to define a custom file system implementation which will be used by LiquidJS to lookup and read template files. See [Abstract File System][abstract-fs] for details.
## globals
**globals** is used to define global variables available to all templates even in cases of [render tag][render]. See [3185][185] for details.
## Trimming
**greedy**, **trimOutputLeft**, **trimOutputRight**, **trimTagLeft**, **trimTagRight** options are used to eliminate extra newlines and indents in templates arround Liquid Constructs. See [Whitespace Control][wc] for details.
## Delimiter
**outputDelimiterLeft**, **outputDelimiterRight**, **tagDelimiterLeft**, **tagDelimiterRight** are used to customize the delimiters for LiquidJS [Tags and Filters][intro]. For example with `outputDelimiterLeft: <%=, outputDelimiterRight: %>` we are able to avoid conflicts with other languages:
```ejs
<%= username | append: ", welcome to LiquidJS!" %>
```
## Strict
**strictFilters** is used to assert filter existence. If set to `false`, undefined filters will be skipped. Otherwise, undefined filters will cause a parse exception. Defaults to `false`.
**strictVariables** is used to assert variable existence. If set to `false`, undefined variables will be rendered as empty string. Otherwise, undefined variables will cause a render exception. Defaults to `false`.
{% note info Non-existent Tags %}
Non-existent tags always throw errors during pasrsing and this behaviour can not be customized.
{% endnote %}
[liquid]: ../api/classes/liquid_.liquid.html
[caching]: ./caching.html
[abstract-fs]: ./render-file.html#Abstract-File-System
[render-file]: ./render-file.html
[185]: https://github.com/harttle/liquidjs/issues/185
[render]: ../tags/render.html
[include]: ../tags/include.html
[layout]: ../tags/layout.html
[wc]: ./whitespace-control.html
[intro]: ./intro-to-liquid.html
+6 -6
View File
@@ -8,12 +8,12 @@ ul#intro-feature-list
.intro-feature-icon
i.icon-shield
h3.intro-feature-title 安全渲染
p.intro-feature-desc 所有输出都默认经过转义,可以安全地开放给客户使用。运算符和表达式都先解析到 AST 再去渲染,避免了 #[code eval] 和 #[code new Function]。
p.intro-feature-desc Liquid 模板有很强的可读性和容错性,适用于开放给设计师和客户。运算符和表达式都先解析到 AST 再去渲染,避免了 #[code eval] 和 #[code new Function]。
li.intro-feature-wrap
.intro-feature
.intro-feature-icon
i.icon-javascript
h3.intro-feature-title 纯 JavaScript
i.icon-rocket
h3.intro-feature-title 零依赖
p.intro-feature-desc 零 NPM 依赖且没有 Native 绑定的 Liquid 实现,Node.js 和浏览器通用。同时提供了 CDN 可用的 CMD, ESM 和 CJS 打包。
li.intro-feature-wrap
.intro-feature
@@ -24,6 +24,6 @@ ul#intro-feature-list
li.intro-feature-wrap
.intro-feature
.intro-feature-icon
i.icon-cog
h3.intro-feature-title Extensibility
p.intro-feature-desc 整个项目在 TypeScript strict 模式下重写,确保了一致的 API 和实时更新的文档。除了 60+ 内置标签和过滤器之外,LiquidJS 还提供了 API 来注册你自己的插件
i.icon-typescript
h3.intro-feature-title TypeScript
p.intro-feature-desc 整个项目在 TypeScript strict 模式下重写,让这个库拥有顺滑的使用体验,同时确保了一致的 API 和实时的、精确的文档
+97
View File
@@ -0,0 +1,97 @@
---
title: 选项
---
[Liquid][liquid] 构造函数接受一个参数对象,用来定义各种模板引擎行为。这些参数都是可选的,比如我可以指定其中一个参数 `cache`
```javascript
const { Liquid } = require('liquidjs')
const engine = new Liquid({
cache: true
})
```
{% note info API 文档 %}
下面的所有选项的概述,希望了解具体的类型和签名,请前往 <a href="https://liquidjs.com/api/interfaces/liquid_options_.liquidoptions.html" target="_self">LiquidOptions | API</a>.
{% endnote %}
## cache
**cache** 用来指定是否缓存曾经读取和处理过的模板来提升性能。在生产环境模板会重复渲染的情况会很有用。
默认是 `false`,当设置为 `true` 时会启用一个大小为 1024 的 LRU 缓存。当然也可以传一个数字来指定缓存大小。此外还可以是一个自定义的缓存实现,LiquidJS 会通过它来查找和读写文件。详情请参考 [Caching][caching]。
## dynamicPartials
**dynamicPartials** 表示是否把传给 [include][include], [render][render], [layout][layout] 标签的文件名当做变量处理。默认为 `true`。例如用上下文 `{ file: 'foo.html' }` 渲染下面的模板将会引入文件 `foo.html`
```liquid
{% include file %}
```
设置 `dynamicPartials: false` 后 LiquidJS 将会尝试去读取 `file`。当你的模板之间都是静态引入关系时会很有用:
```liquid
{% liquid foo.html %}
```
{% note warn Common Pitfall %}
LiquidJS 把这个选项默认值设为 <code>true</code> 以兼容于 shopify/liquid,但如果你在使用 <a href="https://github.com/11ty/eleventy" target="_blank">eleventy</a> 它会设置默认值 <code>false</code> (参考 <a href="https://www.11ty.dev/docs/languages/liquid/#quoted-include-paths" target="_blank">Quoted Include Paths</a>)以兼容于 Jekyll。{% endnote %}
## extname
**extname** 定义了默认的文件后缀,当传入文件名不包含后缀时自动追加。默认值是 `''` 也就是说默认是禁用的。如果设置为 `.liquid`
```liquid
{% render "foo" %} 会加载 foo.liquid
{% render "foo.html" %} 会加载 foo.html
```
{% note info Legacy Versions %}
在 2.0.1 之前,<code>extname</code> 默认值为 `.liquid`。要禁用它需要明确设置为 <code>extname: ''</code>。详情参考 <a href="https://github.com/harttle/liquidjs/issues/41" target="_blank">#41</a>。
{% endnote %}
## root
**root** 用来指定 LiquidJS 查找和读取模板的根目录。可以是单个字符串,也可以是一个数组 LiquidJS 会顺序查找。详情请参考 [Render Files][render-file]。
## fs
**fs** 用来自定义文件系统实现,详情请参考 [Abstract File System][abstract-fs]。
## globals
**globals** 用来定义对所有模板可见的全局变量。包括 [render tag][render] 引入的子模板,见 [3185][185]。
## 换行和缩进
**greedy**, **trimOutputLeft**, **trimOutputRight**, **trimTagLeft**, **trimTagRight** 选项用来移除 Liquid 语法周围的换行和缩进,详情请参考 [Whitespace Control][wc]。
## 自定义分隔符
**outputDelimiterLeft**, **outputDelimiterRight**, **tagDelimiterLeft**, **tagDelimiterRight** 用来自定义 LiquidJS 中 [标签和过滤器][intro] 的分隔符。例如设置了 `outputDelimiterLeft: <%=, outputDelimiterRight: %>` 后我们可以避免跟其他模板引擎冲突:
```ejs
<%= username | append: ", welcome to LiquidJS!" %>
```
## 严格模式
**strictFilters** 用来启用过滤器的严格模式,如果设置为 `true` 过滤器不存在时解析会抛出异常。默认为 `false`,这时会跳过不存在的过滤器。
**strictVariables** 用来启用变量严格模式。如果设置为 `true` 变量不存在时渲染会抛出异常,默认为 `false` 这时不存在的变量会被渲染为空字符串。
{% note info 不存在的标签 %}
不存在的标签总是会抛出一个解析异常,这一行为无法自定义。
{% endnote %}
[liquid]: ../api/classes/liquid_.liquid.html
[caching]: ./caching.html
[abstract-fs]: ./render-file.html#Abstract-File-System
[render-file]: ./render-file.html
[185]: https://github.com/harttle/liquidjs/issues/185
[render]: ../tags/render.html
[include]: ../tags/include.html
[layout]: ../tags/layout.html
[wc]: ./whitespace-control.html
[intro]: ./intro-to-liquid.html
+3 -1
View File
@@ -30,8 +30,9 @@ page:
sidebar:
tutorials:
getting_started: Getting Started
intro: Intro to Liquid
setup: Setup
syntax: Basic Syntax
options: Options
render_file: Render Files
partials: Includes and Layouts
express: Use in Express.js
@@ -47,6 +48,7 @@ sidebar:
miscellaneous: Miscellaneous
migration9: 'Migrate to LiquidJS 9'
contribution_guidelines: 'Contribution Guidelines'
changelog: 'Changelog'
filters:
overview: Overview
tags:
+8 -6
View File
@@ -30,16 +30,17 @@ page:
sidebar:
tutorials:
getting_started: 开始使用
setup: 安装和引入
syntax: 基本语法
render_file: 渲染一个文件
partials: 引用和继承
express: 在 Express.js 里使用
intro: Liquid 简介
setup: 安装
options: 选项
render_file: 文件渲染
partials: 引用/继承
express: Express.js 中使用
advanced: 高级主题
caching: 缓存
registeration: 注册标签/过滤器
whitespace: 空白字符控制
whitespace: 换行和缩进
plugins: 插件
operators: 运算符
truth: 真和假
@@ -47,6 +48,7 @@ sidebar:
miscellaneous: 其他
migration9: '迁移到 LiquidJS 9'
contribution_guidelines: '贡献指南'
changelog: '更新日志'
filters:
overview: 概述
tags:
+6 -6
View File
@@ -31,9 +31,6 @@ i {
.icon-network:before {
content: "\e902";
}
.icon-javascript:before {
content: "\e901";
}
.icon-opencollective:before {
content: "\e903";
}
@@ -43,9 +40,6 @@ i {
.icon-search:before {
content: "\f002";
}
.icon-cog:before {
content: "\f013";
}
.icon-gear:before {
content: "\f013";
}
@@ -70,3 +64,9 @@ i {
.icon-shield:before {
content: "\f132";
}
.icon-rocket:before {
content: "\e9a5";
}
.icon-typescript:before {
content: "\e900";
}
+12 -2
View File
@@ -50,7 +50,7 @@ note-warn = hsl(0, 100%, 50%)
overflow-y: auto
#article-toc-top
margin-top: 10px
margin-top: 13px
font-size: 0.9em
text-decoration: none
color: color-default
@@ -134,6 +134,14 @@ note-warn = hsl(0, 100%, 50%)
&:after
content: " (" attr(href) ")"
font-size: 80%
&[target="_blank"]
position: relative
&::after
content: '\00f08e'
font-family: 'icomoon'
padding-left: 3px;
vertical-align: super;
zoom: .7
strong
font-weight: bold
em
@@ -180,10 +188,12 @@ note-warn = hsl(0, 100%, 50%)
&.warn
border-left-color: note-warn
.note-title
margin: 1em 0
margin: 1em 0 0.5em
display: block
font-size: 1.3em
font-weight: bold
+ *
margin-top: 0
table
max-width: 100%
border: 1px solid color-border
Binary file not shown.
+3 -2
View File
@@ -7,17 +7,18 @@
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xe901;" glyph-name="javascript" d="M0 950.857h1024v-1024h-1024zM940.117 171.081c-7.467 46.72-37.888 85.973-128.128 122.581-31.403 14.72-66.304 24.96-76.672 48.64-3.883 14.080-4.48 21.76-1.963 30.080 6.4 27.563 39.040 35.84 64.64 28.16 16.64-5.12 32-17.92 41.643-38.4 44.117 28.843 44.117 28.843 74.88 48-11.52 17.92-17.237 25.643-25.003 33.28-26.88 30.080-62.677 45.44-120.917 44.117l-30.080-3.797c-28.843-7.040-56.32-22.4-72.96-42.88-48.64-55.083-34.603-151.083 24.277-190.763 58.24-43.52 143.403-53.077 154.283-94.080 10.24-49.92-37.12-65.92-83.883-60.16-34.603 7.68-53.76 25.003-74.88 57.003l-78.080-44.843c8.96-20.48 19.2-29.397 34.56-47.317 74.24-74.923 259.84-71.083 293.163 42.837 1.237 3.84 10.24 30.080 3.157 70.4zM556.843 480.201h-95.915c0-82.688-0.384-164.864-0.384-247.68 0-52.565 2.688-100.821-5.888-115.669-14.080-29.397-50.347-25.643-66.816-20.48-16.896 8.363-25.472 19.883-35.413 36.48-2.688 4.48-4.693 8.363-5.419 8.363l-77.867-48c13.013-26.88 32-50.005 56.491-64.725 36.48-21.76 85.504-28.8 136.832-17.28 33.408 9.643 62.208 29.483 77.269 60.203 21.76 39.68 17.152 88.32 16.939 142.763 0.512 87.637 0 175.317 0 263.637z" />
<glyph unicode="&#xe900;" glyph-name="typescript" d="M0 438.857v-512h1024v1024h-1024zM825.216 479.646c26.027-6.485 45.824-18.048 64.043-36.907 9.429-10.069 23.424-28.416 24.533-32.853 0.341-1.28-44.203-31.147-71.168-47.915-0.981-0.64-4.907 3.584-9.259 10.069-13.227 19.2-27.008 27.477-48.128 28.928-31.061 2.133-51.029-14.123-50.859-41.259-0.021-0.475-0.034-1.031-0.034-1.59 0-6.444 1.624-12.51 4.484-17.809l-0.098 0.199c6.827-14.123 19.541-22.613 59.307-39.808 73.344-31.573 104.704-52.352 124.203-81.92 21.76-32.981 26.667-85.675 11.861-124.843-16.213-42.581-56.533-71.509-113.28-81.067-17.536-3.115-59.136-2.645-77.995 0.768-41.131 7.339-80.128 27.648-104.192 54.315-9.429 10.368-27.819 37.547-26.667 39.467 0.469 0.683 4.693 3.285 9.387 6.016 4.608 2.603 21.803 12.544 38.059 21.973l29.44 17.067 6.187-9.131c8.619-13.141 27.435-31.189 38.827-37.205 32.683-17.237 77.525-14.805 99.627 5.035 8.22 6.956 13.403 17.28 13.403 28.814 0 0.67-0.018 1.337-0.052 1.998l0.004-0.093c0 11.861-1.493 17.067-7.68 26.027-7.936 11.349-24.192 20.907-70.357 40.96-52.821 22.741-75.563 36.864-96.384 59.307-12.556 14.254-22.22 31.382-27.871 50.244l-0.246 0.956c-3.883 14.464-4.864 50.731-1.792 65.323 10.88 51.072 49.408 86.613 105.003 97.195 18.048 3.413 59.989 2.133 77.696-2.261zM584.832 436.894l0.341-41.941h-133.333v-378.709h-94.293v378.709h-133.205v41.131c0 22.784 0.469 41.813 1.109 42.24 0.512 0.683 81.621 1.024 179.925 0.853l178.987-0.512z" />
<glyph unicode="&#xe902;" glyph-name="network" d="M512-73.143c-282.77 0-512 229.23-512 512s229.23 512 512 512v0c282.77 0 512-229.23 512-512s-229.23-512-512-512v0zM908.8 336.457c8.251 30.73 12.99 66.012 12.99 102.4s-4.739 71.67-13.634 105.261l0.644-2.861h-195.584c2.267-30.637 3.559-66.368 3.559-102.4s-1.292-71.763-3.832-107.148l0.273 4.748h195.584zM866.816 234.057h-164.864c-9.503-67.086-26.518-127.646-50.456-184.579l1.816 4.867c91.262 34.305 165.167 97.283 212.455 177.781l1.049 1.931zM413.696 336.457h196.608c2.654 30.668 4.168 66.357 4.168 102.4s-1.513 71.734-4.48 107.010l0.312-4.61h-196.608c-2.654-30.668-4.168-66.357-4.168-102.4s1.513-71.734 4.48-107.010l-0.312 4.61zM426.496 234.057c20.992-122.88 57.856-204.8 85.504-204.8s64.512 81.92 85.504 204.8h-171.008zM115.2 336.457h195.584c-2.267 30.637-3.559 66.368-3.559 102.4s1.292 71.763 3.832 107.148l-0.273-4.748h-195.584c-8.251-30.73-12.99-66.012-12.99-102.4s4.739-71.67 13.634-105.261l-0.644 2.861zM157.184 234.057c48.337-82.429 122.242-145.407 210.673-178.775l2.831-0.937c-21.504 49.152-37.888 110.592-48.64 179.712h-164.864zM866.816 643.657c-48.337 82.429-122.242 145.407-210.673 178.775l-2.831 0.937c21.504-49.152 37.888-110.592 48.64-179.712h164.864zM426.496 643.657h171.008c-20.992 122.88-57.856 204.8-85.504 204.8s-64.512-81.92-85.504-204.8zM157.184 643.657h164.864c10.24 69.12 27.136 130.56 48.64 179.712-91.262-34.305-165.167-97.283-212.455-177.781l-1.049-1.931z" />
<glyph unicode="&#xe903;" glyph-name="opencollective" d="M932.693 730.27c57.298-81.265 91.58-182.336 91.58-291.413s-34.281-210.149-92.657-293.026l1.077 1.613-132.267 132.267c25.95 45.863 41.242 100.719 41.242 159.147s-15.292 113.284-42.092 160.785l0.85-1.638zM803.413 859.55l-132.267-132.267c-45.751 25.644-100.402 40.747-158.58 40.747-181.68 0-328.96-147.28-328.96-328.96s147.28-328.96 328.96-328.96c58.179 0 112.83 15.103 160.247 41.602l-1.666-0.855 132.267-132.693c-81.392-57.006-182.473-91.093-291.516-91.093-282.77 0-512 229.23-512 512s229.23 512 512 512c109.043 0 210.124-34.088 293.168-92.188l-1.652 1.095zM932.693 730.27c57.298-81.265 91.58-182.336 91.58-291.413s-34.281-210.149-92.657-293.026l1.077 1.613-132.267 132.267c25.95 45.863 41.242 100.719 41.242 159.147s-15.292 113.284-42.092 160.785l0.85-1.638z" />
<glyph unicode="&#xe904;" glyph-name="patreon" d="M656.469 928.5c-203.264 0-368.64-165.376-368.64-368.64 0-202.667 165.376-367.488 368.64-367.488 202.667 0 367.531 164.864 367.531 367.488 0 203.264-164.864 368.64-367.531 368.64zM0.128-53.388h180.053v981.888h-180.053z" />
<glyph unicode="&#xe905;" glyph-name="shopify" d="M654.379-72.247l307.883 66.603c0 0-111.104 751.488-112 756.48-0.768 4.949-4.864 8.192-9.003 8.192s-82.304 5.803-82.304 5.803-54.4 54.357-61.397 60.203c-1.92 1.579-3.2 2.432-5.163 3.157l-38.997-900.437zM499.627 468.51c0 0-34.56 18.091-75.691 18.091-61.739 0-64.171-38.656-64.171-48.683 0-52.565 138.24-73.173 138.24-197.504 0-97.92-61.44-160.427-145.323-160.427-100.437 0-151.040 62.507-151.040 62.507l27.563 89.003c0 0 53.12-45.483 97.28-45.483 28.8 0 41.6 23.253 41.6 39.765 0 69.077-113.237 72.277-113.237 185.984-1.451 95.445 67.029 188.416 205.952 188.416 53.632 0 80-15.403 80-15.403l-40.32-115.84zM476.587 915.444c5.803 0 11.563-1.621 17.28-5.76-41.984-19.84-88.064-69.931-107.008-170.325-27.989-9.088-55.168-17.28-80.597-24.661 22.144 76.16 75.648 200.32 170.325 200.32zM529.28 789.62v-5.76c-32.171-9.899-67.541-20.651-102.144-31.403 19.883 75.819 56.875 112.853 88.96 126.763 8.235-21.376 13.184-50.176 13.184-89.6zM552.277 884.937c29.611-3.157 48.683-36.992 60.971-74.88-14.891-4.864-31.36-9.856-49.408-15.616v10.752c0 32.085-4.096 58.496-11.563 79.829zM679.936 829.94c-0.853 0-2.56-0.896-3.328-0.896s-12.331-3.2-30.464-8.96c-18.048 52.608-50.176 101.12-107.008 101.12h-4.907c-16.469 20.736-36.352 29.653-53.589 29.653-132.523 0-195.84-165.419-215.68-249.429-50.944-15.573-88.021-27.136-92.16-28.757-28.8-9.088-29.611-9.899-32.939-37.12-3.2-19.712-78.080-600.021-78.080-600.021l578.603-108.672z" />
<glyph unicode="&#xe9a5;" glyph-name="rocket" d="M704 886.857l-320-320h-192l-192-256c0 0 203.416 56.652 322.066 30.084l-322.066-414.084 421.902 328.144c58.838-134.654-37.902-328.144-37.902-328.144l256 192v192l320 320 64 320-320-64z" />
<glyph unicode="&#xf002;" glyph-name="search" horiz-adv-x="951" d="M658.286 475.428c0 141.143-114.857 256-256 256s-256-114.857-256-256 114.857-256 256-256 256 114.857 256 256zM950.857 0c0-40-33.143-73.143-73.143-73.143-19.429 0-38.286 8-51.429 21.714l-196 195.429c-66.857-46.286-146.857-70.857-228-70.857-222.286 0-402.286 180-402.286 402.286s180 402.286 402.286 402.286 402.286-180 402.286-402.286c0-81.143-24.571-161.143-70.857-228l196-196c13.143-13.143 21.143-32 21.143-51.429z" />
<glyph unicode="&#xf013;" glyph-name="cog, gear" horiz-adv-x="878" d="M585.143 438.857c0 80.571-65.714 146.286-146.286 146.286s-146.286-65.714-146.286-146.286 65.714-146.286 146.286-146.286 146.286 65.714 146.286 146.286zM877.714 501.143v-126.857c0-8.571-6.857-18.857-16-20.571l-105.714-16c-6.286-18.286-13.143-35.429-22.286-52 19.429-28 40-53.143 61.143-78.857 3.429-4 5.714-9.143 5.714-14.286s-1.714-9.143-5.143-13.143c-13.714-18.286-90.857-102.286-110.286-102.286-5.143 0-10.286 2.286-14.857 5.143l-78.857 61.714c-16.571-8.571-34.286-16-52-21.714-4-34.857-7.429-72-16.571-106.286-2.286-9.143-10.286-16-20.571-16h-126.857c-10.286 0-19.429 7.429-20.571 17.143l-16 105.143c-17.714 5.714-34.857 12.571-51.429 21.143l-80.571-61.143c-4-3.429-9.143-5.143-14.286-5.143s-10.286 2.286-14.286 6.286c-30.286 27.429-70.286 62.857-94.286 96-2.857 4-4 8.571-4 13.143 0 5.143 1.714 9.143 4.571 13.143 19.429 26.286 40.571 51.429 60 78.286-9.714 18.286-17.714 37.143-23.429 56.571l-104.571 15.429c-9.714 1.714-16.571 10.857-16.571 20.571v126.857c0 8.571 6.857 18.857 15.429 20.571l106.286 16c5.714 18.286 13.143 35.429 22.286 52.571-19.429 27.429-40 53.143-61.143 78.857-3.429 4-5.714 8.571-5.714 13.714s2.286 9.143 5.143 13.143c13.714 18.857 90.857 102.286 110.286 102.286 5.143 0 10.286-2.286 14.857-5.714l78.857-61.143c16.571 8.571 34.286 16 52 21.714 4 34.857 7.429 72 16.571 106.286 2.286 9.143 10.286 16 20.571 16h126.857c10.286 0 19.429-7.429 20.571-17.143l16-105.143c17.714-5.714 34.857-12.571 51.429-21.143l81.143 61.143c3.429 3.429 8.571 5.143 13.714 5.143s10.286-2.286 14.286-5.714c30.286-28 70.286-63.429 94.286-97.143 2.857-3.429 4-8 4-12.571 0-5.143-1.714-9.143-4.571-13.143-19.429-26.286-40.571-51.429-60-78.286 9.714-18.286 17.714-37.143 23.429-56l104.571-16c9.714-1.714 16.571-10.857 16.571-20.571z" />
<glyph unicode="&#xf040;" glyph-name="pencil" horiz-adv-x="866" d="M207.429 73.143l52 52-134.286 134.286-52-52v-61.143h73.143v-73.143h61.143zM506.286 603.428c0 7.429-5.143 12.571-12.571 12.571-3.429 0-6.857-1.143-9.714-4l-309.714-309.714c-2.857-2.857-4-6.286-4-9.714 0-7.429 5.143-12.571 12.571-12.571 3.429 0 6.857 1.143 9.714 4l309.714 309.714c2.857 2.857 4 6.286 4 9.714zM475.429 713.143l237.714-237.714-475.429-475.429h-237.714v237.714zM865.714 658.286c0-19.429-8-38.286-21.143-51.429l-94.857-94.857-237.714 237.714 94.857 94.286c13.143 13.714 32 21.714 51.429 21.714s38.286-8 52-21.714l134.286-133.714c13.143-13.714 21.143-32.571 21.143-52z" />
<glyph unicode="&#xf053;" glyph-name="chevron-left" d="M783.783 728.070l-289.213-289.213 289.213-289.213c13.616-13.616 13.616-35.403 0-49.019l-90.414-90.414c-13.616-13.616-35.403-13.616-49.019 0l-404.135 404.135c-13.616 13.616-13.616 35.403 0 49.019l404.135 404.135c13.616 13.616 35.403 13.616 49.019 0l90.414-90.414c13.616-13.616 13.616-35.403 0-49.019z" />
<glyph unicode="&#xf054;" glyph-name="chevron-right" d="M783.783 414.347l-404.135-404.135c-13.616-13.616-35.403-13.616-49.019 0l-90.413 90.413c-13.616 13.616-13.616 35.403 0 49.019l289.213 289.213-289.213 289.213c-13.616 13.616-13.616 35.403 0 49.019l90.413 90.413c13.616 13.616 35.403 13.616 49.019 0l404.135-404.135c13.616-13.616 13.616-35.403 0-49.019z" />
<glyph unicode="&#xf061;" glyph-name="arrow-right" d="M995.737 438.856c0-22.347-8.545-44.036-24.318-59.81l-427.871-427.871c-15.774-15.117-37.463-24.318-59.81-24.318s-43.378 9.202-59.153 24.318l-49.294 49.294c-15.774 15.774-24.975 37.463-24.975 59.81s9.202 44.036 24.975 59.81l192.576 192.576h-462.706c-47.322 0-76.898 39.435-76.898 84.128v84.128c0 44.693 29.576 84.128 76.898 84.128h462.706l-192.576 193.233c-15.774 15.117-24.975 36.806-24.975 59.153s9.202 44.036 24.975 59.153l49.294 49.294c15.774 15.774 36.806 24.975 59.153 24.975s44.036-9.202 59.81-24.975l427.871-427.871c15.774-15.117 24.318-36.806 24.318-59.153z" />
<glyph unicode="&#xf08e;" glyph-name="external-link" d="M804.571 420.571v-182.857c0-90.857-73.714-164.571-164.571-164.571h-475.429c-90.857 0-164.571 73.714-164.571 164.571v475.429c0 90.857 73.714 164.571 164.571 164.571h402.286c10.286 0 18.286-8 18.286-18.286v-36.571c0-10.286-8-18.286-18.286-18.286h-402.286c-50.286 0-91.429-41.143-91.429-91.429v-475.429c0-50.286 41.143-91.429 91.429-91.429h475.429c50.286 0 91.429 41.143 91.429 91.429v182.857c0 10.286 8 18.286 18.286 18.286h36.571c10.286 0 18.286-8 18.286-18.286zM1024 914.286v-292.571c0-20-16.571-36.571-36.571-36.571-9.714 0-18.857 4-25.714 10.857l-100.571 100.571-372.571-372.571c-3.429-3.429-8.571-5.714-13.143-5.714s-9.714 2.286-13.143 5.714l-65.143 65.143c-3.429 3.429-5.714 8.571-5.714 13.143s2.286 9.714 5.714 13.143l372.571 372.571-100.571 100.571c-6.857 6.857-10.857 16-10.857 25.714 0 20 16.571 36.571 36.571 36.571h292.571c20 0 36.571-16.571 36.571-36.571z" />
<glyph unicode="&#xf099;" glyph-name="twitter" d="M1024 755.933c-28.588-41.583-64.324-78.619-105.258-108.508 0.649-9.096 0.649-18.193 0.649-27.289 0-277.442-211.166-597.116-597.116-597.116-118.903 0-229.359 34.438-322.275 94.214 16.894-1.948 33.137-2.6 50.68-2.6 98.113 0 188.425 33.137 260.548 89.665-92.264 1.948-169.583 62.376-196.223 145.543 12.996-1.948 25.99-3.249 39.635-3.249 18.842 0 37.685 2.6 55.228 7.148-96.162 19.492-168.284 103.96-168.284 205.969v2.6c27.938-15.593 60.426-25.341 94.864-26.64-56.527 37.685-93.565 102.009-93.565 174.781 0 38.986 10.396 74.72 28.588 105.908 103.31-127.35 258.6-210.517 432.73-219.614-3.249 15.593-5.197 31.838-5.197 48.082 0 115.654 93.565 209.867 209.867 209.867 60.426 0 115.005-25.341 153.34-66.275 47.43 9.096 92.913 26.64 133.198 50.68-15.593-48.731-48.731-89.665-92.264-115.654 42.233 4.548 83.167 16.245 120.854 32.487z" />
<glyph unicode="&#xf09b;" glyph-name="github" d="M512.001 940.068c283.684 0 513.843-230.159 513.843-513.843 0-226.814-147.194-419.506-351.26-487.749-26.094-4.684-35.46 11.374-35.46 24.755 0 16.728 0.669 72.258 0.669 141.173 0 48.173-16.058 78.951-34.792 95.007 114.41 12.713 234.841 56.202 234.841 253.575 0 56.202-20.073 101.699-52.857 137.828 5.353 13.381 22.749 65.568-5.353 136.489-42.819 13.381-141.173-52.857-141.173-52.857-40.813 11.374-84.971 17.395-128.46 17.395s-87.647-6.021-128.46-17.395c0 0-98.352 66.237-141.173 52.857-28.1-70.921-10.705-123.109-5.353-136.489-32.784-36.129-52.857-81.626-52.857-137.828 0-196.706 119.764-240.864 234.174-253.575-14.719-13.381-28.1-36.129-32.784-68.913-29.439-13.381-104.375-36.129-149.203 42.819-28.1 48.842-78.951 52.857-78.951 52.857-50.179 0.669-3.345-31.445-3.345-31.445 33.453-15.389 56.871-74.936 56.871-74.936 30.108-91.662 173.288-60.886 173.288-60.886 0-42.819 0.669-82.965 0.669-95.676 0-13.381-9.366-29.439-35.46-24.755-204.066 68.246-351.26 260.935-351.26 487.749 0 283.684 230.159 513.843 513.843 513.843zM192.856 202.088c1.339 2.676-0.669 6.021-4.684 8.029-4.015 1.339-7.36 0.669-8.699-1.339-1.339-2.676 0.669-6.021 4.684-8.029 3.345-2.006 7.36-1.339 8.699 1.339zM213.598 179.34c2.676 2.006 2.006 6.69-1.339 10.705-3.345 3.345-8.029 4.684-10.705 2.006-2.676-2.006-2.006-6.69 1.339-10.705 3.345-3.345 8.029-4.684 10.705-2.006zM233.669 149.232c3.345 2.676 3.345 8.029 0 12.713-2.676 4.684-8.029 6.69-11.374 4.015-3.345-2.006-3.345-7.36 0-12.044s8.699-6.69 11.374-4.684zM261.771 121.132c2.676 2.676 1.339 8.699-2.676 12.713-4.684 4.684-10.705 5.353-13.381 2.006-3.345-2.676-2.006-8.699 2.676-12.713 4.684-4.684 10.705-5.353 13.381-2.006zM299.906 104.404c1.339 4.015-2.676 8.699-8.699 10.705-5.353 1.339-11.374-0.669-12.713-4.684s2.676-8.699 8.699-10.035c5.353-2.006 11.374 0 12.713 4.015zM342.058 101.059c0 4.684-5.353 8.029-11.374 7.36-6.021 0-10.705-3.345-10.705-7.36 0-4.684 4.684-8.029 11.374-7.36 6.021 0 10.705 3.345 10.705 7.36zM380.865 107.749c-0.669 4.015-6.021 6.69-12.044 6.021-6.021-1.339-10.035-5.353-9.366-10.035 0.669-4.015 6.021-6.69 12.044-5.353s10.035 5.353 9.366 9.366z" />
<glyph unicode="&#xf132;" glyph-name="shield" d="M810.665 396.19v426.666h-298.667v-758c34.001 18 88.667 49.334 142 91.334 71.333 56 156.667 143.333 156.667 240zM938.666 908.19v-511.999c0-280.666-392.666-457.999-409.333-465.333-5.333-2.667-11.334-4-17.333-4s-12 1.333-17.333 4c-16.668 7.334-409.333 184.667-409.333 465.333v511.999c0 23.334 19.333 42.667 42.667 42.667h767.999c23.334 0 42.667-19.333 42.667-42.667z" />

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -13,9 +13,9 @@ export interface LiquidOptions {
cache?: boolean | number | Cache<Template[]>;
/** If set, treat the `filepath` parameter in `{%include filepath %}` and `{%layout filepath%}` as a variable, otherwise as a literal value. Defaults to `true`. */
dynamicPartials?: boolean;
/** Enable strict filter existence. If set to `false`, undefined filters will be rendered as empty string. Otherwise, undefined filters will cause an exception. Defaults to `false`. */
/** Whether or not to assert filter existence. If set to `false`, undefined filters will be skipped. Otherwise, undefined filters will cause an exception. Defaults to `false`. */
strictFilters?: boolean;
/** Enable strict variable derivation. If set to `false`, undefined variables will be rendered as empty string. Otherwise, undefined variables will cause an exception. Defaults to `false`. */
/** Whether or not to assert variable existence. If set to `false`, undefined variables will be rendered as empty string. Otherwise, undefined variables will cause an exception. Defaults to `false`. */
strictVariables?: boolean;
/** Strip blank characters (including ` `, `\t`, and `\r`) from the right of tags (`{% %}`) until `\n` (inclusive). Defaults to `false`. */
trimTagRight?: boolean;