This class reference is valid for all Hugo and Go grammars. Exceptions are mentioned in the respective sections.

Core modes used

Standard scopes (classes)

The following standard scopes are used to style the output. Make sure your style has a definition for them.

New scopes (classes)

Themes out in the wild won’t have styles for these. If you do not define any for these special subclasses, Highlight.js will fallback to the parent style.

Keywords

We divide Go/Hugo keywords into the following standard scopes.

HINT: Keywords for Hugo are generated at build time from a recent version of the docs. For older template code bases this may result in missing highlighting ancient keywords/built_ins. The Go template keywords are manually picked from the docs.

Sub modes

The HTML grammars use XML as subLanguage. Check the official documentation for scopes used there.


  1. mentioned deeper down in the go template docs. ↩︎

  2. better match than keyword↩︎