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.

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (0)

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay