Outputting Literal curly braces in Liquid templates

不羁的心 提交于 2019-12-03 10:28:36

What about using the numeric HTML entities { and } for { and } respectively - presumably this is to be output as HTML?

EDIT: Forgive me, I'm not too familiar with liquid (so this might be very wrong), but can you assign your {{ example }} special value to a variable and output that? May be something like:

{% assign special = '{{ example }}' %}
{{ special }}
Marcel Jackwerth

You can also use raw:

{% raw %}

...lots of liquid code goes here and it doesn't get interpreted...

{% endraw %}
Richard Nienaber

This is the only thing that worked from me. Lifted from here:

{{ "{{ this " }}}}

I needed this because I wanted to reference the site global variable from inside a mustache template.

You can escape the HTML, for example in a {{var}} you can use \{\{var\}\}, so that way luquid don't process it.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!