In a previous post I mentioned that I would be using Prism.js as my syntax highlighter. Originally, I tried adding
prism.rb to my
_plugins directory. That let me use the prism liquid tag locally:
BUT! After pushing those changes to Github, I recieved a build error email:
The page build failed with the following error:
_posts/2014-08-26-look-ma-no-wordpress.markdownis not a recognized Liquid tag. For more information, see https://help.github.com/articles/page-build-failed-unknown-tag-error.
The link leads to a page explaining how to use Jekyll plugins with Github Pages. Unfortunately, only a handfull of plugins are supported, and Prism isn’t one of them.
The workaround solution is to remove
prism.rb from your
_plugins directory, and use plain markdown to build your code blocks instead:
Aside from a little more verbosity, the only real downside that I can find with this approach is that if your first line of code is not inline with your
<pre><code> line, you will have an extra line break before your first line of code.