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

问题描述

这听起来很简单,但是我在文档中的任何地方都找不到它.我如何在液体模板中编写{% 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

参考

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

05-26 18:06
查看更多