File: liquid.md

package info (click to toggle)
jekyll 4.3.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,356 kB
  • sloc: ruby: 16,765; javascript: 1,455; sh: 214; xml: 29; makefile: 9
file content (38 lines) | stat: -rw-r--r-- 1,462 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
title: Liquid Options
permalink: "/docs/configuration/liquid/"
---
Liquid's response to errors can be configured by setting `error_mode`. The
options are

- `lax` --- Ignore all errors.
- `warn` --- Output a warning on the console for each error. (default)
- `strict` --- Output an error message and stop the build.

Within _config.yml, the default configuration is as follows:

```yaml
liquid:
  error_mode: warn
```

The above example depicts the "warn" value, which is already set by default- `error_mode: warn`. This results in any issues being called out during the build process however will continue to build if possible.

You can also configure Liquid's renderer to catch non-assigned variables and
non-existing filters by setting `strict_variables` and / or `strict_filters`
to `true` respectively. {% include docs_version_badge.html version="3.8.0" %}

Do note that while `error_mode` configures Liquid's parser, the `strict_variables`
and `strict_filters` options configure Liquid's renderer and are consequently
orthogonal.

An example of setting these variables within _config.yml is as follows:

```yaml
liquid:
  error_mode: strict
  strict_variables: true
  strict_filters: true
```

Configuring as described above will stop your build/serve from happening and call out the offending error and halt. This is helpful when desiring to catch liquid-related issues by stopping the build or serve process and allowing you to deal with any issues.