Merge commit '81a7b6390036138356773c87a886679c81c524e1'

This commit is contained in:
Bjørn Erik Pedersen
2025-01-16 10:35:07 +01:00
2 changed files with 5 additions and 5 deletions

View File

@@ -64,7 +64,7 @@ In its default configuration, Hugo renders Markdown headings according to the [C
[CommonMark specification]: https://spec.commonmark.org/current/
{{< code file=layouts/_default/_markup/render-heading.html copy=true >}}
<h{{ .Level }} id="{{ .Anchor }}">
<h{{ .Level }} id="{{ .Anchor }}" {{- with .Attributes.class }} class="{{ . }}" {{- end }}>
{{- .Text -}}
</h{{ .Level }}>
{{< /code >}}
@@ -72,7 +72,7 @@ In its default configuration, Hugo renders Markdown headings according to the [C
To add an anchor link to the right of each heading:
{{< code file=layouts/_default/_markup/render-heading.html copy=true >}}
<h{{ .Level }} id="{{ .Anchor }}">
<h{{ .Level }} id="{{ .Anchor }}" {{- with .Attributes.class }} class="{{ . }}" {{- end }}>
{{ .Text }}
<a href="#{{ .Anchor }}">#</a>
</h{{ .Level }}>