Jekyll: Highlighting code snippets using markdown syntax

github-flavored-markdown, jekyll, markdown

Solution

I had to add the following to my _config.yml to get my GitHub Pages syntax highlighting to work:

markdown: redcarpet
extensions: [fenced_code_blocks]

I don't know why `fenced_code_blocks` is required for GitHub Pages, since it's supposed to be enabled by default in Jekyll.

Problem

The Jekyll docs state that code highlighting is done using Liquid tags as follows: ``` {% highlight ruby %} def show @widget = Widget(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @widget } end end {% endhighlight %} ``` However, I would rather like to use Markdown syntax: ```` ```ruby def foo puts 'foo' end ``` ```` I tried it myself the following way: ```` ``` ini ; Disables the splash screen, if it has been compiled into the launcher. RunLocally=true ``` ```` However, the result does not look the way it should.

Original source