4

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.

enter image description here

1
  • 1
    I am not entirely sure whether it was a caching issue on Github or a missing config setting but I added markdown: redcarpet to _config.yml and now code samples are rendered using the markdown syntax. Commented Nov 30, 2013 at 18:31

1 Answer 1

10

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Does this hold for Jekyll 3?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.