How To Escape Liquid Template Tags In Jekyll
My blog has been on Github Pages for about a week now. So far, so good. I’ll say this again, Jekyll + Github Pages, a dev’s dream! I especially like the syntax highlighting provided by the Pygments plugin. So sweet, so simple.
One of the tricks I’ve learnt since is how to highlight Liquid Template code, within the Liquid template you’re working on!
This is accomplished using a combination of the HTML syntax highlighting made available by Pygments, and the {% raw %}
tag provided by Liquid (Talk about inception!). For example, if you want to display the code snippet below:
Then this is the code you should have in your markdown file:
Easy to select, huh?
Grab the gist here!
Happy hacking!