0

I am making my own theme in Jekyll, and I wanted to use syntax highlighting.

For this I did:

1) Install rouge and kramdown in my Gemfile

gem 'kramdown'
gem 'rouge'

2) Update my _config.yml

markdown: kramdown
highlighter: rouge

3) Write some code in my post

{% highlight javascript %}
$(".myClass").on("click", function(){...});
{% endhighlight %}

But I am still not getting any highlighting.

Why is that? Do I need to include an specific css file in the <head>?

Enrique Moreno Tent
  • 24,127
  • 34
  • 104
  • 189

1 Answers1

1

I think it's possible you forgot to install the gems locally. You shouldn't need to add the stylesheet but do check your browser console for any errors.

You should also be able to export a base stylesheet and extend it as needed:

rougify style base16.solarized.dark > css/syntax.css


<link href="/css/syntax.css" rel="stylesheet">
Keith Mifsud
  • 1,599
  • 1
  • 16
  • 26