mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-31 09:05:47 +02:00
Replace AnchorJS with a Hugo render hook (#32953)
* Replace AnchorJS with a Hugo render hook * docs(anchors): improve aria-label on anchor links * docs(anchors): show anchor link when ed * docs(anchors): add hash in pseudo-element Co-authored-by: Gaël Poupard <ffoodd@users.noreply.github.com>
This commit is contained in:
5
site/layouts/_default/_markup/render-heading.html
Normal file
5
site/layouts/_default/_markup/render-heading.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}
|
||||
{{- if and (ge .Level .Page.Site.Params.anchors.min) (le .Level .Page.Site.Params.anchors.max) }}{{" " -}}
|
||||
<a class="anchor-link" href="#{{ .Anchor | safeURL }}" aria-label="Link to this section: {{ .Text | safeHTML }}"></a>
|
||||
{{- end -}}
|
||||
</h{{ .Level }}>
|
Reference in New Issue
Block a user