Syntax highlighting markdown code blocks in Jekyll (without using liquid tags)

前端 未结 9 1944
灰色年华
灰色年华 2020-12-04 09:19

It seems like syntax highlighting in Jekyll is limited to using liquid tags and pygments like so:

{% highlight bash %}
cd ~
{% endhighlight %}
9条回答
  •  情话喂你
    2020-12-04 09:54

    You can also use the triple-tilde syntax:

    ~~~ruby
    class Base
      def two
        1 + 1
      end
    end
    ~~~
    

    which is supported by Kramdown (Jekyll).

提交回复
热议问题