DEV Community

Cover image for How to highlight liquid code in Jekyll
Adrian Matei for Codever

Posted on • Edited on • Originally published at codever.dev

2

How to highlight liquid code in Jekyll

Project: codepediaorg.github.io

You need to place {% raw %} and {% endraw %} tags around your code. Since Jekyll 4.0 , you can add render_with_liquid: false in your front matter to disable Liquid entirely for a particular document. Use the standard Code snippet highlighting from Jekyll:

{% highlight liquid %}
{% raw %}
      {% if page.categories[0] != "snippets" %}
        {% include promote-bookmarks.dev.html %}
      {% endif %}
{% endraw %}
{% endhighlight %}
Enter fullscreen mode Exit fullscreen mode

Or place it in markdown code markers:

Enter fullscreen mode Exit fullscreen mode


liquid

{% if page.categories[0] != "snippets" %}
{% include promote-bookmarks.dev.html %}
{% endif %}

Enter fullscreen mode Exit fullscreen mode


Reference -

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



Shared ❤️ from Codever. 👉 use the copy to mine functionality to add it to your personal snippets collection.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay