Replace pygments and {% highlight %} syntax with GFM
I have just seen this, which has convinced me that using GFM code fences is the right way to go (even though I don't particularly like them).
The highlight zone
GitHub Pages now only supports Rouge, a pure-Ruby syntax highlighter, meaning you no longer need to install Python and Pygments to preview your site locally. If you were previously using Pygments for highlighting, the two libraries are feature compatible, so we'll swap Rouge in for Pygments when we build your site, to ensure a seamless transition.
Traditionally, highlighting in Jekyll has been implemented via the {% highlight %} Liquid tag, forcing you to leave a pure-Markdown experience. With kramdown and Rouge as the new defaults, syntax highlighting on GitHub Pages should work like you'd expect it to work anywhere else on GitHub, with native support for backtick-style fenced code blocks right within the Markdown.
So, we should replace all instances of {% highlight %} and drop the pygments css.
Does this mean that we can drop that extra CSS? IIRC from my testing a few weeks ago, neither code formatting method worked without the custom CSS. Or maybe the issue was that the default CSS didn't look right on our site... I'm not sure.
Did you edit highlight: in _config.yml? I haven't tried it, you could be right that we need to keep the css.
Maybe? 😊 I can't say it was a particularly scientific test... I don't want to draw any conclusions based on my demonstrably bad memory.