diff options
| author | Bobby <[email protected]> | 2024-08-16 20:47:33 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-08-16 20:47:33 -0400 |
| commit | 6b28433d9cfde435be8ec2bd6cf91e6324d08865 (patch) | |
| tree | 8343c27b8b95ff5639233e81cf157f92e5688466 /site/layouts/_default/_markup/render-heading.html | |
| parent | d53094ec16ba385faae2973ddee648698b32ab24 (diff) | |
| parent | 048f56f51460df75e92a2f7b472e1c56baeb68f7 (diff) | |
| download | bootstrap-6b28433d9cfde435be8ec2bd6cf91e6324d08865.tar.xz bootstrap-6b28433d9cfde435be8ec2bd6cf91e6324d08865.zip | |
Diffstat (limited to 'site/layouts/_default/_markup/render-heading.html')
| -rw-r--r-- | site/layouts/_default/_markup/render-heading.html | 7 |
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 }}> |
