Add {% hubl %} tag

Open
#1,116 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
backend

Research direction

Start with the linked Shopify Liquid tag documentation and compare its syntax with the example in the issue. Done means Jinjava accepts the proposed {% hubl ... %} block and preserves the shown conditional behavior; the issue names no repository files or tests, so those must be located before implementation.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Java
Stars
785
Forks
184
Avg merge
6d 22h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from HubSpot/jinjava

All issues in HubSpot/jinjava

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.