Skip to content

Commit

Permalink
Render-heading: process class attributes (#2165)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin authored Jan 9, 2025
1 parent dd5e69b commit 88ec5ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion layouts/_default/_markup/td-render-heading.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<h{{ .Level }} id="{{- .Anchor | safeURL -}}">
<h{{ .Level }} id="{{ .Anchor | safeURL }}"
{{- with .Attributes.class }} class="{{ . }}" {{- end -}}
>
{{- .Text | safeHTML -}}
{{ template "_default/_markup/_td-heading-self-link.html" . -}}
</h{{ .Level }}>
Expand Down
1 change: 1 addition & 0 deletions userguide/content/en/docs/adding-content/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ params:
{{< /tabpane >}}

## Heading self links
{.test-class}

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

0 comments on commit 88ec5ae

Please sign in to comment.