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

前端 未结 9 1948
灰色年华
灰色年华 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:55

    Redcarpet is integrated integrated into Jekyll by default and code highlighting will function as expected.

    For older Jekyll blogs:

    1. Install redcarpet gem:

      gem install redcarpet

    2. Update _config.yaml

      markdown: redcarpet
      

    For reference and further info see:

    Closed Github Issue

    Updated Jekyll Codebase

提交回复
热议问题