Proposal: Add highlighting support for Go/Hugo templates to Discourse

I would say you used a fenced code block with ```html resulting in a fixed class using highlight.js XML language
<code class="lang-html hljs language-xml"

you want either no class for autodetection or hugo-html :slight_smile:

  • fixed hugo-html results in <code class="lang-hugo-html hljs language-hugo-html">
  • autodetect results in <class="hljs language-hugo-html">

with class: ```hugo-html

{{ with resources.Get "css/main.css" | css.Build }}
  {{ if hugo.IsDevelopment }}
    <link rel="stylesheet" href="{{ .RelPermalink }}">
  {{ else }}
    {{ with . | fingerprint }}
      <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
    {{ end }}
  {{ end }}
{{ end }}

autodetect (just ```)

{{ with resources.Get "css/main.css" | css.Build }}
  {{ if hugo.IsDevelopment }}
    <link rel="stylesheet" href="{{ .RelPermalink }}">
  {{ else }}
    {{ with . | fingerprint }}
      <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
    {{ end }}
  {{ end }}
{{ end }}

importing hugo-text would allow to use ```hugo-text which would only highlight the hugo actions leaving the html unstyled.