我正在尝试从液体模板中输出以下内容:
{{ example }}
显然,Liquid认为这是一个名为变量example并尝试进行替换.我试图找出如何输出实际的大括号.
到目前为止,我发现了一种有效的方法,但它非常难看:
{{ '{example'|prepend:'{' }}}}
是的,告诉你这很糟糕.
以下是我尝试过的其他事情:
{{{ example }}}     # outputs '}'
{{{{ example }}}}   # outputs '}}'
\{\{ example \}\}   # outputs '\{\{ example \}\}'
有什么建议吗?
Mar*_*rth 118
你也可以使用raw:
{% raw %}
...lots of liquid code goes here and it doesn't get interpreted...
{% endraw %}
MrW*_*ite 10
What about using the numeric HTML entities { and } for { and } respectively - presumably this is to be output as HTML?
编辑:原谅我,我不太熟悉液体(所以这可能是非常错误的),但你可以将你的{{ example }}特殊值分配给变量并输出吗?可能是这样的:
{% assign special = '{{ example }}' %}
{{ special }}