aboutsummaryrefslogtreecommitdiff
path: root/site/layouts/_default/_markup
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
parentd53094ec16ba385faae2973ddee648698b32ab24 (diff)
parent048f56f51460df75e92a2f7b472e1c56baeb68f7 (diff)
downloadbootstrap-main.tar.xz
bootstrap-main.zip
Merge branch 'twbs:main' into mainHEADmain
Diffstat (limited to 'site/layouts/_default/_markup')
-rw-r--r--site/layouts/_default/_markup/render-heading.html7
-rw-r--r--site/layouts/_default/_markup/render-image.html8
2 files changed, 15 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 }}>
diff --git a/site/layouts/_default/_markup/render-image.html b/site/layouts/_default/_markup/render-image.html
new file mode 100644
index 000000000..fd089f7be
--- /dev/null
+++ b/site/layouts/_default/_markup/render-image.html
@@ -0,0 +1,8 @@
+{{- $originalSrc := .Destination | safeURL -}}
+{{- $localImgPath := path.Join "/site/static/docs" site.Params.docs_version $originalSrc -}}
+{{- /* This shouldn't be needed but we have a weird folder structure with version included... */ -}}
+{{- $src := urls.JoinPath "/docs" site.Params.docs_version $originalSrc -}}
+{{- $config := imageConfig $localImgPath -}}
+{{- $classes := "d-block img-fluid" -}}
+
+<img src="{{ $src }}" class="{{ $classes }}" alt="{{ .Text }}" width="{{ $config.Width }}" height="{{ $config.Height }}" loading="lazy">