How to use markdown code highlighting for Liquid in JekyllRB?

257 Views Asked by At

Using JekyllRB/Rouge, how does one highlight (but not interpret) Liquid code within a markdown file?

IE:

I have a markdown file with:

Blah blah blah, my cool post... here's some code:

```liquid
{% assign variableName = 'test' %}
```

In the resulting HTML, I'd like to see the actual code, without Jekyll interpreting it within the markdown file.

1

There are 1 best solutions below

0
On

I figured it out.

Make use of the {% raw %} Liquid tag.

IE:

```
{% raw %}
  {{ somevariablewewanttoshow }}
{% endraw %}
```