Rick Cogley's Tech Logr

Short Technical Laser Bursts %%

RC Logr 20190301 082710

Friday, 1 Mar, 2019

Was pleasantly suprised at how easy it is to get syntax highlighting going in Hugo, since its inclusion of the fast Golang-based «Chroma» library, and even making it backward compatible with most pygments settings. My config.toml contains the following:

1
2
3
4
pygmentsOptions = "linenos=table"
pygmentsCodeFences = "true"
pygmentsCodefencesGuessSyntax = "true"
pygmentsStyle = "tango"

… and to get it to work you just use a code fence (three backticks) specifying the language like:

1
2
3
```toml
pygmentsStyle = "monokailight"
```

RC Logr 20190301 082710 - Was pleasantly suprised at how … Rick Cogley
Back to Home Tweet Link