Document some of the undocumented features

This commit is contained in:
Brian Jones
2017-03-29 23:01:40 -04:00
parent 7ecc10b989
commit 2f703b30db
3 changed files with 58 additions and 0 deletions

View File

@@ -68,3 +68,17 @@ You can read more about each type of tag in their respective sections.
```text
{{ "/my/fancy/url" | append: ".html" }}
```
Multiple filters can be used on one output. They are applied from left to right.
<p class="code-label">Input</p>
```liquid
{% raw %}
{{ "adam!" | capitalize | prepend: "Hello " }}
{% endraw %}
```
<p class="code-label">Output</p>
```text
Hello Adam!
```

22
tags/comments.md Normal file
View File

@@ -0,0 +1,22 @@
---
title: Comments
description: An overview of comments tags in the Liquid template language.
---
Allows you to leave un-rendered code inside a Liquid template. Any text within
the opening and closing `comment` blocks will not be output, and any Liquid code
within will not be executed.
<p class="code-label">Input</p>
```liquid
{% raw %}
Any contents that you put between {% comment %} and {% endcomment %} tags
is turned into a comment.
{% endraw %}
```
<p class="code-label">Output</p>
```liquid
Any contents that you put between {% comment %} and {% endcomment %} tags
is turned into a comment.
```

22
tags/raw.md Normal file
View File

@@ -0,0 +1,22 @@
---
title: Raw
description: An overview of raw tags in the Liquid template language.
---
Raw temporarily disables tag processing. This is useful for generating content
(eg, Mustache, Handlebars) which uses conflicting syntax.
<p class="code-label">Input</p>
```text
{% raw %}
{% raw %}
In Handlebars, {{ this }} will be HTML-escaped, but {{{ that }}} will not.
{% endraw % }
{% endraw %}
```
<p class="code-label">Output</p>
```liquid
Any contents that you put between {% comment %} and {% endcomment %} tags
is turned into a comment.
```