mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
docs: update docs for website
This commit is contained in:
Generated
+5651
-508
File diff suppressed because it is too large
Load Diff
+6
-5
@@ -3,7 +3,7 @@
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"hexo": {
|
||||
"version": "4.2.0"
|
||||
"version": "5.4.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "hexo generate",
|
||||
@@ -13,7 +13,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"cheerio": "^0.22.0",
|
||||
"hexo": "^4.2.0",
|
||||
"hexo": "^5.4.0",
|
||||
"hexo-algolia": "^1.3.1",
|
||||
"hexo-clean-css": "^1.0.0",
|
||||
"hexo-filter-nofollow": "^2.0.2",
|
||||
@@ -21,15 +21,16 @@
|
||||
"hexo-generator-feed": "^2.0.0",
|
||||
"hexo-generator-sitemap": "^2.0.0",
|
||||
"hexo-renderer-marked": "^2.0.0",
|
||||
"hexo-renderer-pug": "^1.0.0",
|
||||
"hexo-renderer-pug": "^2.0.0",
|
||||
"hexo-renderer-stylus": "^1.0.0",
|
||||
"hexo-renderer-swig": "^1.1.0",
|
||||
"hexo-server": "^1.0.0",
|
||||
"hexo-uglify": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"all-contributors-cli": "^6.8.1",
|
||||
"eslint": "^6.0.1",
|
||||
"eslint-config-hexo": "^4.0.0",
|
||||
"all-contributors-cli": "^6.8.1"
|
||||
"eslint-config-hexo": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.10.0"
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
-
|
||||
url: https://github.com/harttle/liquidjs/pull/5
|
||||
date: '2016-09-12'
|
||||
title:
|
||||
zh-cn: '异步化:重写了解析器和渲染器,使 LiquidJS 可以提供 Promise API 并支持异步的自定义 Tag 实现。'
|
||||
en: 'Async spike: rewrite the parser and render to support Promise, which enables async tags.'
|
||||
-
|
||||
url: https://opencollective.com/liquidjs/#section-contribute
|
||||
date: '2020-02-26'
|
||||
@@ -22,3 +16,9 @@
|
||||
title:
|
||||
zh-cn: '性能提升:引入 AST 并重新设计 Token 类型系统,使渲染性能平均提升 100.3%。'
|
||||
en: 'Performance Boost: a simple AST to improve render performance by 100.3%.'
|
||||
-
|
||||
url: https://github.com/harttle/liquidjs/milestone/3?closed=1
|
||||
date: '2021-09-30'
|
||||
title:
|
||||
zh-cn: '流式渲染:4 倍渲染速度,并增加了对流式渲染的支持。'
|
||||
en: 'Streamed Rendering: now render is 4x faster and support streamed rendering.'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
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:
|
||||
The [Liquid][liquid] constructor accepts a plain object as options to define the behavior 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')
|
||||
@@ -42,7 +42,7 @@ LiquidJS defaults this option to <code>true</code> to be compatible with shopify
|
||||
|
||||
## 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`:
|
||||
**extname** defines the default extension name to be appended into filenames if the filename has no extension name. Defaults to `''` which means it's disabled by default. By setting it to `.liquid`:
|
||||
|
||||
```liquid
|
||||
{% render "foo" %} there's no extname, adds `.liquid` and loads foo.liquid
|
||||
@@ -79,7 +79,7 @@ it defaults to false. For example, when set to true, a blank string would evalu
|
||||
|
||||
## 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.
|
||||
**greedy**, **trimOutputLeft**, **trimOutputRight**, **trimTagLeft**, **trimTagRight** options are used to eliminate extra newlines and indents in templates around Liquid Constructs. See [Whitespace Control][wc] for details.
|
||||
|
||||
## Delimiter
|
||||
|
||||
@@ -98,9 +98,13 @@ it defaults to false. For example, when set to true, a blank string would evalu
|
||||
**lenientIf** modifies the behavior of `strictVariables` to allow handling optional variables. If set to `true`, an undefined variable will *not* cause an exception in the following two situations: a) it is the condition to an `if`, `elsif`, or `unless` tag; b) it occurs right before a `default` filter. Irrelevant if `strictVariables` is not set. Defaults to `false`.
|
||||
|
||||
{% note info Non-existent Tags %}
|
||||
Non-existent tags always throw errors during parsing and this behaviour can not be customized.
|
||||
Non-existent tags always throw errors during parsing and this behavior can not be customized.
|
||||
{% endnote %}
|
||||
|
||||
## Parameter Order
|
||||
|
||||
Parameter orders are ignored by default, for ea `{% for i in (1..8) reversed limit:3 %}` will always perform `limit` before `reversed`, even if `reversed` occurs before `limit`. To make parameter order respected, set **orderedFilterParameters** to `true`. Its default value is `false`.
|
||||
|
||||
[liquid]: ../api/classes/liquid_.liquid.html
|
||||
[caching]: ./caching.html
|
||||
[abstract-fs]: ./render-file.html#Abstract-File-System
|
||||
|
||||
@@ -98,6 +98,10 @@ LiquidJS 把这个选项默认值设为 <code>true</code> 以兼容于 shopify/l
|
||||
不存在的标签总是会抛出一个解析异常,这一行为无法自定义。
|
||||
{% endnote %}
|
||||
|
||||
## 参数顺序
|
||||
|
||||
默认会忽略参数出现的顺序,例如 `{% for i in (1..8) reversed limit:3 %}` 里总是会先执行 `limit` 再执行 `reversed`,虽然 `reversed` 先出现。为了让 LiquidJS 按顺序执行参数,需要设置 **orderedFilterParameters** 为 `true`。它的默认值为 `false`。
|
||||
|
||||
[liquid]: ../api/classes/liquid_.liquid.html
|
||||
[caching]: ./caching.html
|
||||
[abstract-fs]: ./render-file.html#Abstract-File-System
|
||||
|
||||
Reference in New Issue
Block a user