How do you comment out in Liquid?

Solution 1:

In Liquid you comment out using the {% comment %} and {% endcomment %} tags:

{% comment %} This is a comment in Liquid {% endcomment %}

It doesn't matter if the comment is inline or a block comment.

{% comment %}
    This is a block comment in Liquid
{% endcomment %}

Solution 2:

Liquid allows you to leave un-rendered code inside a Liquid template by using the {% comment %} and {% endcomment %} tags.

Input:

Anything you put between {% comment %} and {% endcomment %} tags
is turned into a comment.

Output:

Anything you put between  tags
is turned into a comment.

Reference documentation: Comment tag in Liquid