It seems like syntax highlighting in Jekyll is limited to using liquid tags and pygments like so:
{% highlight bash %}
cd ~
{% endhighlight %}
In latest jekyll support code blocks, but if you use older version, you need to hack.
How about below?
Try to add below's file as your _plugin/triple-backtick.rb
module Jekyll
class MarkdownConverter
alias :old_convert :convert
def convert(content)
content.gsub!(/(?:^|\n)```(\w*)\n(.*\n)```\n/m) do |text|
cls = $1.empty? ? "prettyprint" : "prettyprint lang-#{$1}"
"<pre class=\"#{cls}\"><code>#{$2}</code></pre>"
end
old_convert(content)
end
end
end
I ended up switching to kramdown to parse markdown which comes with coderay for syntax highlighting. This has the benefit of being a pure ruby solution which works on heroku.
I've described 2 alternative solutions to adding properly formatted code snippets to your Jekyll driven site. http://demisx.github.io/jekyll/2014/01/13/improve-code-highlighting-in-jekyll.html. They do not rely on 3-rd party plugins and compatible with free GitHub Pages hosting.