Highlight.js Grammars

Highlight Hugo templates using Highlight.js with additional styles for HuGo specific tokens.

{{ printf "Autodetect Hello %s -> %s" $World .}}
{{- /*  printf "ONE second line */ -}}
<div class="help"/>
{{ range $k, $v := hugo.Generator $ $.Method -}}
{{ site.Language.Label }}
{{ hugo.Sites.Pages }}

You don’t have to be that colorful. If you have a a working setup, just adding new scopes will be a good choice. Have a look at the Discourse examples and Hugo examples to see how it could look like.

Provided Grammars

The modules support Html Text Templates and the Hugo variant has full Hugo keyword and built_in support.

Library files

Download

Packages can be downloaded from: Releases1.

Custom Highlight.js build

To build your own customized Highlight.js installation grab the highlightjs-hugo.zip release asset and extract it in the extra folder of your Highlight.js clone. Build using Highlight.js standard extra build.

Usage

The language plugins work just like any other extra one.

Extended use cases


  1. Draft- and pre-releases have to be manually browsed and downloaded. ↩︎