How to use Redcarpet for syntax highlighting in Jekyll


  • because i don’t wanna use liquid tags. i want to keep my posts in pure markdown in case i need to switch platforms or use the posts elsewhere
  • because Github uses Redcarpet for rendering .md content
  • because it supports fenced code blocks.
  • because it makes working with imported/exported sites easy


sudo gem install redcarpet


In your _config.yml file, add the entry for redcarpet and update the value for markdown.

markdown: redcarpet

  extension: [
    "fenced_code_blocks", # ```javascript ```
    "highlight", # ==highlight==
    "superscript", # 2^(nd)
    "footnotes", # [^somesamplefootnote]