cssjekyllpygments

Do I need to generate a css file from Pygments for my jekyll blog, to enable colorful code snippet?


This is my first time to use Jekyll and Pygments. But I don't know how to insert colorful code snippet.

I successfully installed Pygments, following the official steps, with the markdown like this:

{% highlight ruby %}
def foo
  puts 'foo'
end
{% endhighlight %}

I see the html source code including the classes, however there is no color for the this snippet.

Do I need to generate some css files from Pygments and include them? And how?


Solution

  • You need to include syntax.css

    You can take the sample from my repo https://github.com/madhur/madhur.github.com/blob/master/files/css/syntax.css

    and then customize it according to your theme. Mine is customized for dark backgrounds.