Hugo Code Highlight
categories: hacking
Description/Summary
Hugo uses default built-in code highlight. Change it from config.toml and (maybe) add your own syntax.css.Content
Disable the default
Add this code to the top level in your config.toml. Do not put it below [Params].
pygmentsUseClasses = true
Generate your syntax.css
Hugo’s doc: Generate Syntax Highlighter CSS
hugo gen chromastyles --style=monokai > syntax.css
Replace “monokai” with other names here.
Add the CSS file to the right place, for example,
static/css/syntax.css
and add the path to your header.html or head.html, where stylesheets are imported.