better-comments icon indicating copy to clipboard operation
better-comments copied to clipboard

Add Liquid language support

Open Christopher-Hayes opened this issue 2 years ago • 0 comments

Feature Request: Add Liquid language support.

Description

Liquid is the server-side language use by Shopify and Jekyll. Parsers that treat .liquid like HTML should already work pretty well since it's generally for inserting dynamic content in HTML and running very simple logic.

Official Liquid Language docs: https://shopify.github.io/liquid/

Shopify's Liquid docs: https://shopify.dev/api/liquid

Note that Shopify and Jekyll add additional tags. So, the {% liquid tag used below is something Shopify added to the core language.

Liquid Comments

In HTML (.liquid files)

<h1>Page title</h1>
{% comment %} * This comment will not show in the browser {% endcomment %}
<h2>Section 1</h2>
<!-- * This comment will show in the browser -->

When nested inside a {% liquid tag

{% liquid
assign x = 3
comment * This is a comment
endcomment
assign y = x | add: 1
%}

A better way to comment inside the {% liquid tag is currently being discussed: https://github.com/Shopify/liquid/issues/1393

Christopher-Hayes avatar May 31 '22 21:05 Christopher-Hayes