Skip to content

Latest commit

 

History

History
48 lines (30 loc) · 1.33 KB

convert_include_to_render.md

File metadata and controls

48 lines (30 loc) · 1.33 KB

Discourage the use of include (ConvertIncludeToRender)

The include tag is deprecated. This tag exists to enforce the use of the render tag instead of include.

The include tag works similarly to the render tag, but it lets the code inside of the snippet to access and overwrite the variables within its parent theme file. The include tag has been deprecated because the way that it handles variables reduces performance and makes theme code harder to both read and maintain.

Check Details

This check is aimed at eliminating the use of include tags.

👎 Examples of incorrect code for this check:

{% include 'snippet' %}

👍 Examples of correct code for this check:

{% render 'snippet' %}

Check Options

The default configuration for this check is the following:

ConvertIncludeToRender:
  enabled: true

When Not To Use It

It is discouraged to disable this rule.

Version

This check has been introduced in Theme Check 0.1.0.

Resources