Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Latest commit

 

History

History
65 lines (42 loc) · 1.49 KB

missing_template.md

File metadata and controls

65 lines (42 loc) · 1.49 KB

Prevent missing templates (MissingTemplate)

This check exists to prevent rendering resources with the render tag, section tag (and the deprecated include tag) that do not exist.

Check Details

This check is aimed at preventing liquid rendering errors.

👎 Example of incorrect code for this check:

{% render 'snippet-that-does-not-exist' %}

👍 Example of correct code for this check:

{% render 'article-card' %}

Check Options

The default configuration for this check is the following:

MissingTemplate:
  enabled: true
  ignore_missing: []

ignore_missing

Specify a list of patterns of missing template files to ignore.

While the ignore option will ignore all occurrences of MissingTemplate according to the file in which they appear, ignore_missing allows ignoring all occurrences of MissingTemplate based on the target template, the template being rendered.

For example:

MissingTemplate:
  ignore_missing:
  - snippets/icon-*

Would ignore offenses on {% render 'icon-missing' %} across all theme files.

MissingTemplate:
  ignore:
  - templates/index.liquid

Would ignore all MissingTemplate in templates/index.liquid, no mater the file being rendered.

Version

This check has been introduced in Theme Check 0.1.0.

Resources