Skip to content

Commit 3b84825

Browse files
authored
Heading render hook: support all attributes (#2206)
1 parent dc1121e commit 3b84825

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
<h{{ .Level }} id="{{ .Anchor | safeURL }}"
2-
{{- with .Attributes.class }} class="{{ . }}" {{- end -}}
1+
<h{{ .Level }}
2+
{{- range $key, $value := .Attributes -}}
3+
{{ printf " %s=%q" $key (string $value) | safeHTMLAttr -}}
4+
{{ end -}}
35
>
46
{{- .Text | safeHTML -}}
57
{{ template "_default/_markup/_td-heading-self-link.html" . -}}

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

-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,6 @@ cascade:
341341
```
342342
343343
## Heading self links
344-
{.test-class}
345344
346345
Docsy supports build-time generation of heading self links using Hugo's
347346
`render-heading.html` [hook].

0 commit comments

Comments
 (0)