mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
docs: echo & liquid tags
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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!
|
||||
```
|
||||
@@ -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
|
||||
```
|
||||
Reference in New Issue
Block a user