serhii.net

In the middle of the desert you can say anything you want

08 Nov 2021

211108-1316 Syntax highlight of Hugo templates in code listings

“Hugo uses Go’s html/template and text/template libraries as the basis for the templating.” 1

I tried to use go as “language” in code blocks to highlight Hugo templates and it seems to work nicely!

The result of

```go
{{ range (.Paginate ($pages_l.GroupByDate "2006-01-02")).PageGroups  }}
```

is

{{ range (.Paginate ($pages_l.GroupByDate "2006-01-02")).PageGroups  }}

(I generated the first code listing using the \{-{-< highlight go >\}\} Hugo shortcode)

Nel mezzo del deserto posso dire tutto quello che voglio.