How to highlight liquid code in Jekyll

ama

Adrian Matei

Posted on November 23, 2021

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.

💖 💪 🙅 🚩
ama
Adrian Matei

Posted on November 23, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

How to highlight liquid code in Jekyll