Rendering Liquid and Handlebars Expressions in Jekyll Code Blocks

Written by Michael Lee on March 16, 2016

Sharing blocks of code is something that I do regularly on my site as well as other sites that I blog on.

Liquid (templating library for Jekyll) and Handlebars expressions (templating library found in Ember applications) use the curly braces to render content. When placing them in code blocks in Jekyll, Jekyll will by default try to render them as expressions instead of just raw code.

To fix this issue and render the code block with with Liquid and Handlebars expressions as code and not for Jekyll to try to render as content, you can use the {% raw %} liquid expression.

Thanks for taking the time to read this article. I'd love to stay in touch and share more tips on programming and design, side projects and working remotely. Sign up and I'll send you my articles straight to your email.

:wave: Hey hey, I'm Michael Lee! I really appreciate you taking the time to read this article.

Be sure to check out my other articles.