aboutsummaryrefslogtreecommitdiff
path: root/site/layouts/_default/_markup/render-heading.html
diff options
context:
space:
mode:
authorBobby <[email protected]>2024-08-16 20:47:33 -0400
committerGitHub <[email protected]>2024-08-16 20:47:33 -0400
commit6b28433d9cfde435be8ec2bd6cf91e6324d08865 (patch)
tree8343c27b8b95ff5639233e81cf157f92e5688466 /site/layouts/_default/_markup/render-heading.html
parentd53094ec16ba385faae2973ddee648698b32ab24 (diff)
parent048f56f51460df75e92a2f7b472e1c56baeb68f7 (diff)
downloadbootstrap-6b28433d9cfde435be8ec2bd6cf91e6324d08865.tar.xz
bootstrap-6b28433d9cfde435be8ec2bd6cf91e6324d08865.zip
Merge branch 'twbs:main' into mainHEADmain
Diffstat (limited to 'site/layouts/_default/_markup/render-heading.html')
-rw-r--r--site/layouts/_default/_markup/render-heading.html7
1 files changed, 7 insertions, 0 deletions
diff --git a/site/layouts/_default/_markup/render-heading.html b/site/layouts/_default/_markup/render-heading.html
new file mode 100644
index 000000000..d115f85dc
--- /dev/null
+++ b/site/layouts/_default/_markup/render-heading.html
@@ -0,0 +1,7 @@
+{{- $id := .Anchor | safeURL -}}
+{{- $text := .Text | safeHTML -}}
+<h{{ .Level }} id="{{ $id }}">{{ $text }}
+{{- if and (ge .Level .Page.Site.Params.anchors.min) (le .Level .Page.Site.Params.anchors.max) }}{{" " -}}
+<a class="anchor-link" href="#{{ $id }}" aria-label="Link to this section: {{ $text }}"></a>
+{{- end -}}
+</h{{ .Level }}>