How to disable Rouge syntax highlighting in Jekyll
Jekyll uses Rouge for syntax highlighting by default. If you want plain code blocks, or plan to handle highlighting another way, you can turn it off in _config.yml.
For a normal Jekyll site, add:
highlighter: none
GitHub Pages uses Jekyll with Kramdown, so use Kramdown’s syntax-highlighter option there:
markdown: kramdown
kramdown:
syntax_highlighter_opts:
disable: true
Restart the local Jekyll server after changing _config.yml; configuration changes are not always picked up while the server is running. Your fenced code blocks will remain in the page, but Rouge will no longer add syntax-highlighted markup.
Enjoyed reading this?
If you found this article helpful, consider supporting my writing. Every little bit helps keep this blog going.
Related articles
- The HTTP Status Codes I Actually Check
A practical guide to common HTTP response codes, redirects, client and server errors, and the headers that explain them.
- What Makes a Website a Progressive Web App?
A practical look at service workers, web app manifests, installation, and the cases where a Progressive Web App is worth building.
- What a Static Site Generator Actually Does
A static site generator combines content and templates before deployment, producing HTML files that a web server can deliver directly.