Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add {% hubl %} tag #1116

Open
johnsfuller opened this issue Sep 29, 2023 · 0 comments
Open

Add {% hubl %} tag #1116

johnsfuller opened this issue Sep 29, 2023 · 0 comments

Comments

@johnsfuller
Copy link

Feature request

Just like shopify has a {% liquid %} tag (see liquid tag in their docs), it would be beneficial to have a block of hubl without delimeters on each tag.

Example

Before:

{% if foo == 'bar' %}
  {% set my_variable = 'xyz' %}
{% elif foo == 'baz' %}
  {% set my_variable = 'pdq' %}
{% else %}
  {% set my_variable = 'examine your zipper on channel 2' %}
{% endif %}

After:

{% hubl
  if foo == 'bar'
    set my_variable = 'xyz'
  elif foo == 'baz'
    set my_variable = 'pdq'
  else
    set my_variable = 'examine your zipper on channel 2'
  endif
%}

Why

Shopify recommends using their liquid tag if four or more consecutive Liquid tags ({% ... %}) are found. They've even commited to that rule in their official theme check – and I think for good reason. Modules can get complicated – even with standard hubl functions and our own custom macros. The delimiters get clunky quick and I think a lot of devs get worn out.

This was originally brought up in this slack idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant