Skip to content

Commit f62b210

Browse files
zxx457harttle
andauthoredOct 22, 2022
docs: add echo and liquid tags Chinese translation (#549)
* docs: add echo and liquid tags chinese translation * Update docs/source/zh-cn/tags/echo.md Co-authored-by: Jun Yang <harttleharttle@gmail.com> * Update docs/source/zh-cn/tags/echo.md Co-authored-by: Jun Yang <harttleharttle@gmail.com> * Update docs/source/zh-cn/tags/echo.md Co-authored-by: Jun Yang <harttleharttle@gmail.com> * Update Liquid.md * Update Liquid.md Co-authored-by: Jun Yang <harttleharttle@gmail.com>
1 parent bf6b5c7 commit f62b210

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
 

‎docs/source/zh-cn/tags/echo.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: Echo
3+
---
4+
5+
{% since %}v9.31.0{% endsince %}
6+
7+
根据表达式输出渲染 HTML。和使用 `{{` expression `}}` 包裹模板效果一样,不同的是 echo 可以在 liquid 标签中使用,同时也支持过滤器。
8+
9+
## echo
10+
11+
输入
12+
```liquid
13+
{% assign username = 'Bob' %}
14+
{% echo username | append: ", welcome to LiquidJS!" | capitalize %}
15+
```
16+
17+
输出
18+
```text
19+
Bob, welcome to LiquidJS!
20+
```

‎docs/source/zh-cn/tags/liquid.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Liquid
3+
---
4+
5+
{% since %}v9.31.0{% endsince %}
6+
7+
通过 liquid 标签可以在一个分隔符中使用多个标签, 使 Liquid 逻辑书写更简洁。
8+
9+
## liquid
10+
11+
输入
12+
```liquid
13+
{% liquid
14+
assign names = 'Bob, Sally' | split: ', '
15+
16+
for name in names
17+
echo 'Hello, ' | append: name
18+
unless forloop.last
19+
echo ', '
20+
endunless
21+
endfor
22+
%}
23+
```
24+
25+
输出
26+
```text
27+
Hello, Bob, Hello Sally
28+
```

0 commit comments

Comments
 (0)
Please sign in to comment.