Skip to content

Commit 88ec5ae

Browse files
authored
Render-heading: process class attributes (#2165)
1 parent dd5e69b commit 88ec5ae

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

layouts/_default/_markup/td-render-heading.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<h{{ .Level }} id="{{- .Anchor | safeURL -}}">
1+
<h{{ .Level }} id="{{ .Anchor | safeURL }}"
2+
{{- with .Attributes.class }} class="{{ . }}" {{- end -}}
3+
>
24
{{- .Text | safeHTML -}}
35
{{ template "_default/_markup/_td-heading-self-link.html" . -}}
46
</h{{ .Level }}>

userguide/content/en/docs/adding-content/navigation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ params:
314314
{{< /tabpane >}}
315315

316316
## Heading self links
317+
{.test-class}
317318

318319
Docsy supports build-time generation of heading self links using Hugo's
319320
`render-heading.html` [hook].

0 commit comments

Comments
 (0)