如何逃避液体模板标签? [英] How to escape liquid template tags?

查看:54
本文介绍了如何逃避液体模板标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这听起来很简单,但是我在文档中的任何地方都找不到它.我如何在液体模板中编写{% this %}而不被引擎处理?

This sounds very easy, however I couldn't find it anywhere in the docs. How can I write {% this %} in a liquid template, without it being processed by the engine?

推荐答案

对于将来的搜索者,一种无需插件即可逃脱的方法,请使用以下代码:

For future searchers, there is a way to escape without plugins, use the code below:

{{ "{% this " }}%}

对于标签,要转义{{ this }},请使用:

and for tags, to escape {{ this }} use:

{{ "{{ this " }}}}


为此还提供了一个jekyll插件,使它变得更加简单: https://gist.github. com/1020852

jekyll的原始标签.避免在{%raw%}之间解析文本 和{%endraw%}

Raw tag for jekyll. Keeps liquid from parsing text betweeen {% raw %} and {% endraw %}

参考

这篇关于如何逃避液体模板标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆