As I started creating new tech entries on my site, I ran into the problem of writing samples of liquid template code. Liquid kept trying to translate my sample code into actual code.
So this:
{% highlight html %}
{% for post in paginator.posts %}
<div class="teaser clearfix">
<div class="title"><a href="{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a></div>
<div class="meta"><span class="timeago">{{ post.date | time_ago }}</span>{{ post.tags | tag_links }}</div>
<div class="description">{{ post.description }}</div>
</div>
{% endfor %}
{% endhighlight %}
...was causing errors because the template kept trying to translate the for
loop into code.
It turns out that all you have to do is put this after the highlight
tag:
{% raw %}
...lots of liquid code goes here and it doesn't get interpreted...
{% endraw %}