Technical blogs are usually going to have code examples and if you’re a Jekyll refugee exploring Middleman, you’ll be accustomed to creating fenced code blocks surrounded by backticks. Something like this:
``` code_block = Codeblock.new(:with_backticks) ```
Middleman uses kramdown to parse and convert Markdown into Html and kramdown by default expects tildes for fenced code blocks:
~~~ code_block = Codeblock.new(:with_tildes) ~~~
To get a backtick flavoured code block, you need to specify a Github Flavoured Markdown (GFM) parser in your config.rb.
To set up your Middleman powered blog so that kramdown accepts backtick fenced code blocks, follow the usual setup guides and then, in
config.rb add the following:
set :markdown_engine, :kramdown set :markdown, fenced_code_blocks: true, input: "GFM"