Merging upstream version 5.3.5+dfsg.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
8838637a85
commit
449962af96
233 changed files with 6665 additions and 12847 deletions
22
site/layouts/partials/responsive-img.html
Normal file
22
site/layouts/partials/responsive-img.html
Normal file
|
@ -0,0 +1,22 @@
|
|||
{{- /*
|
||||
Accepts context, classes, imgPath, alt and lazyload
|
||||
*/ -}}
|
||||
|
||||
{{- $lazy := .lazyload | default true -}}
|
||||
{{- $classes := slice "img-fluid" "mx-auto" | append (slice .classes) -}}
|
||||
|
||||
{{- $basePath := path.Join "/docs" .context.Site.Params.docs_version (path.Dir .imgPath) -}}
|
||||
{{- $basename := path.BaseName .imgPath -}}
|
||||
{{- $ext := path.Ext .imgPath -}}
|
||||
{{- $imgPath := path.Join $basePath (printf "%s%s" $basename $ext) -}}
|
||||
{{- $imgPath2x := path.Join $basePath (printf "%s@2x%s" $basename $ext) -}}
|
||||
|
||||
{{- with (imageConfig (path.Join "/site/static" $imgPath)) }}
|
||||
<img class="{{ delimit $classes " " }}"
|
||||
srcset="{{ $imgPath }}, {{ $imgPath2x }} 2x"
|
||||
src="{{ $imgPath }}"
|
||||
alt="{{ $.alt }}"{{ if eq $lazy true }}
|
||||
loading="lazy"{{ end }}
|
||||
width="{{ .Width }}"
|
||||
height="{{ .Height }}">
|
||||
{{- end }}
|
Loading…
Add table
Add a link
Reference in a new issue