Shopify / liquid

Liquid markup language. Safe, customer facing template language for flexible web apps.
https://shopify.github.io/liquid/
MIT License
11.09k stars 1.39k forks source link

Customize the tag tokens syntax in Liquid #884

Open ishu3101 opened 7 years ago

ishu3101 commented 7 years ago

In nunjucks templating engine, if you want different tokens than {{ and the rest for variables, blocks, and comments, you can specify different tokens as the tags option like so (as mentioned on https://mozilla.github.io/nunjucks/api.html#customizing-syntax.)

var env = nunjucks.configure('/path/to/templates', {
  tags: {
    blockStart: '<%',
    blockEnd: '%>',
    variableStart: '<$',
    variableEnd: '$>',
    commentStart: '<#',
    commentEnd: '#>'
  }
});

Using this environment, templates will look like this in nunjucks:

<ul>
<% for item in items %>
  <li><$ item $></li>
<% endfor %>
</ul>

Is it possible to do the same in Liquid templating engine which is used in Jekyll?

pushrax commented 7 years ago

It is not currently possible to change the tag characters.

ishu3101 commented 7 years ago

Any there any plans to support that?

pushrax commented 7 years ago

There aren't currently any plans to support this configuration. It may become an option once the regex-based parser is finally removed (no ETA).