Jekyll Markdown & Liquid Syntax

Quick Guide to Avoid Syntax Errors

Posted by Jason-json on September 5, 2025

Jekyll Liquid Syntax Fix

The Problem

  • Jekyll processes all curly braces `` and percent tags as template code
  • This breaks when you try to show code examples containing these characters
  • Results in “Liquid syntax error” and failed builds

The Solution

Wrap any problematic code in raw tags:


Your code with {{ }} or {% %} here

How to Apply the Fix

For Inline Code

Wrap with raw tags:

`{{ your.code.here }}`

For Code Blocks

Wrap the entire block:


```javascript
const obj = {{ key: 'value' }};

```

Common Triggers

  • JavaScript template literals with ${ }
  • Vue.js or Angular syntax with ``
  • Any code showing Jekyll/Liquid examples
  • Handlebars templates

Quick Fix Steps

  1. Find the line causing the error
  2. Wrap the problematic code with and
  3. Commit and push
  4. Build should succeed

Prevention

  • Always use raw tags when documenting template syntax
  • Test locally with bundle exec jekyll serve before pushing
  • Keep code examples in separate files when possible