I got following render-heading.html
file in layout\_default\_markup
<h{{ .Level }}
{{- range $k, $v := .Attributes -}}{{- printf " %s=%q" $k $v | safeHTMLAttr -}}{{- end -}}
id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}
<a class="anchor" href="#{{ .Anchor | safeURL }}">#</a>
</h{{ .Level }}>
I would like to add condition to it, like {{ if .Params.faq }}
it will not display <a class="anchor" href="#{{ .Anchor | safeURL }}">#</a>
.
Like:
<h{{ .Level }}
{{- range $k, $v := .Attributes -}}{{- printf " %s=%q" $k $v | safeHTMLAttr -}}{{- end -}}
id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}
{{ if (not .Params.faq) }}<a class="anchor" href="#{{ .Anchor | safeURL }}">#</a>{{ end }}
</h{{ .Level }}>
but that result in an error
execute of template failed: template: _default/_markup/render-heading.html:1:176: executing "_default/_markup/render-heading.html" at <.Params.faq>: can't evaluate field Params in type goldmark.headingContext
Is there any other way to achieve that?