Markup Matryoshka: Jinja2 inside of Jekyll
Have you ever tried to write a Jekyll blog post with Jinja2 code inside of it? You probably wrote something like this:
{% highlight awk %}
This Jinja2 code is going to be soooooooooo {{ adjective }}
{% endhighlight %}
Which probably actually rendered to something like this:
{% highlight awk %}
This Jinja2 code is going to be soooooooooo
{% endhighlight %}
It’s going to be soooooo? Sooooo what?!
Solution: just use the {% raw %} and {% endraw %} tags:
This Jinja2 code is going to be soooooooooo {% raw %} {{ adjective }} {% endraw %}
Now, how did we insert inline {% raw %} and {% endraw %} tags without Jekyll choking on them? You’ll just have to check out the source for this post on our GitHub.