Writing about Jekyll Tags in Jekyll

The Blog of Tom Webster

  2015-10-28 03:08:45 PDT

Just ran into an annoying situation. How do you write about Jekyll tags ({% tag %}) inside of Jekyll? How do you get it to avoid parsing?

The best answer I've found is this Stack Overflow answer.

The basic gist of it is you can use {{"{% mytag "}}%}. Liquid allows you to use quotes inside of template tags as string literals, so you put half of the statement inside your literal-template-tag, then leave the last half outside of it. This fakes Liquid into not parsing the tag since it is technically incomplete, but leaving you with the text you'd like to show on the page.

Also! Don't break it on a new line, that will cause Jekyll parsing errors!