Blog

Disable Liquid Rendering in Code Blocks

Frontend

Jekyll is a static site generator used by many people around the world.

I also launched the website using Jekyll recently.

When using curly braces in code blocks, they are rendered with liquid. So if you don't want to render them, you need to add one of the following in the markdown file.

Option 1: Add the render_with_liquid: false to the Front Matter. (since Jekyll 4.0)

---
title: Sample Title
render_with_liquid: false

---


<!-- code block here -->

Option 2: Surround a code block with {% raw %} and {% endraw %} .

---
title: Sample Title
---




<!-- code block here -->

Reference: https://jekyllrb.com/docs/liquid/tags/