From 426e050b321346bcc6df22723800382b11c8ca67 Mon Sep 17 00:00:00 2001 From: "jaybe@jekyll" Date: Sat, 13 Jun 2020 01:59:21 -0500 Subject: [PATCH] Add language and examples to describe how to use the configuration options. (#8249) Merge pull request 8249 --- docs/_docs/configuration/liquid.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/_docs/configuration/liquid.md b/docs/_docs/configuration/liquid.md index fd050f61..1783fc88 100644 --- a/docs/_docs/configuration/liquid.md +++ b/docs/_docs/configuration/liquid.md @@ -9,6 +9,13 @@ options are - `warn` --- Output a warning on the console for each error. - `strict` --- Output an error message and stop the build. +Within _config.yml, this could be configured as follows: + +```yaml +liquid: + error_mode: warn +``` + 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" %} @@ -16,3 +23,14 @@ 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, mutually exclusive. + +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 a build/serve from happening and instead 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 forcing you to deal with it.