Highlight code block in Hugo
Highlight codes in Hugo - It’s changed Old Hugo Around a year ago (2019), we need to configure pygments in order to highlight codes in code block. Here are sample lines in config.toml file.
... pygmentsCodefences = true pygmentsCodefencesGuessSyntax = true pygmentsStyle = "monokai" ... Latest Hugo (2020) At the new version Hugo in 2020, Hugo officially supports code highlight as a default as a default.
Official syntax highlighting: https://gohugo.io/content-management/syntax-highlighting/#highlighting-in-code-fences