How to escape liquid template tags?

Attila O. picture Attila O. · Aug 6, 2010 · Viewed 25.6k times · Source

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?

Answer

Khaja Minhajuddin picture Khaja Minhajuddin · May 3, 2011

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

{{ "{% this " }}%}

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

{{ "{{ this " }}}}

There is also a jekyll plugin for this which makes it a whole lot easier: https://gist.github.com/1020852

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

Reference