How to escape liquid template tags?

BTW:

If you want to display {{ "{% this " }}%}in Jekyll, you can code like this:

{{ "{{ " }}"{{ "{% this" }} " }}{{ "}}%}

To escape {{ "{{ this " }}}}use:

{{ "{{ " }}"{{ "{{ this" }} " }}{{ "}}}}

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


You can escape liquid tags in Jekyll posts using {% raw %} {% endraw %} i.e

{% raw %}
  {% for post in site.posts %}
     {{ post.content }}
  {% endfor %}

{% endraw %}

will produce

  {% for post in site.posts %}
     {{ post.content }}
  {% endfor %}

it is possible to disable liquid processing engine using the raw tag:

{% raw  %}
{% this %}
{% endraw %}

will display

{% this %}