mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-08 01:47:24 +01:00
2ba7dae3c0
Images are now lazyloaded, they have width and height attributes and the classes are centralized. Only applies to Markdown images
9 lines
540 B
HTML
9 lines
540 B
HTML
{{- $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">
|