docs: echo & liquid tags

This commit is contained in:
Harttle
2021-12-19 22:31:02 +08:00
committed by Harttle
parent be3463c5f9
commit 49d3f64873
3 changed files with 50 additions and 0 deletions
+2
View File
@@ -79,11 +79,13 @@ tags:
comment: comment.html
cycle: cycle.html
decrement: decrement.html
echo: echo.html
for: for.html
if: if.html
include: include.html
increment: increment.html
layout: layout.html
liquid: liquid.html
raw: raw.html
render: render.html
tablerow: tablerow.html
+20
View File
@@ -0,0 +1,20 @@
---
title: Echo
---
{% since %}v9.31.0{% endsince %}
Outputs an expression in the rendered HTML. This is identical to wrapping an expression in `{{` and `}}`, but works inside liquid tags and supports filters.
## echo
Input
```liquid
{% assign username = 'Bob' %}
{% echo username | append: ", welcome to LiquidJS!" | capitalize %}
```
Output
```text
Bob, welcome to LiquidJS!
```
+28
View File
@@ -0,0 +1,28 @@
---
title: Liquid
---
{% since %}v9.31.0{% endsince %}
Encloses multiple tags within one set of delimiters, to allow writing Liquid logic more concisely.
## liquid
Input
```liquid
{% liquid
assign names = 'Bob, Sally' | split: ', '
for name in names
echo 'Hello, ' | append: name
unless forloop.last
echo ', '
endunless
endfor
%}
```
Output
```text
Hello, Bob, Hello Sally
```