mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy.org.git
synced 2025-01-30 20:56:52 +00:00
30 lines
1.1 KiB
HTML
30 lines
1.1 KiB
HTML
{{ $src := ( resources.Get ( .Get 0 ) ) }}
|
|
|
|
{{ $tinyw := default "500" }}
|
|
{{ $smallw := default "800" }}
|
|
{{ $mediumw := default "1200" }}
|
|
{{ $largew := default "2400" }}
|
|
|
|
{{ $tiny := $src.Resize (printf "%sx" $tinyw) }}
|
|
{{ $small := $src.Resize (printf "%sx" $smallw) }}
|
|
{{ $medium:= $src.Resize (printf "%sx" $mediumw) }}
|
|
{{ $large := $src.Resize (printf "%sx" $largew) }}
|
|
|
|
<img
|
|
{{ with ( .Get 1 ) }}
|
|
class = "{{ . }}"
|
|
{{ end }}
|
|
srcset='
|
|
{{ with $tiny.RelPermalink }} {{.}} {{(printf "%sw" $tinyw)}} {{ end }},
|
|
{{ with $small.RelPermalink }} {{.}} {{(printf "%sw" $smallw)}} {{ end }},
|
|
{{ with $medium.RelPermalink }} {{.}} {{(printf "%sw" $mediumw)}} {{ end }},
|
|
{{ with $large.RelPermalink }} {{.}} {{(printf "%sw" $largew)}} {{ end }}
|
|
'
|
|
sizes='
|
|
(max-width: {{(printf "%spx" $tinyw)}}) {{(printf "%spx" $tinyw)}},
|
|
(max-width: {{(printf "%spx" $smallw)}}) {{(printf "%spx" $smallw)}},
|
|
(max-width: {{(printf "%spx" $mediumw)}}) {{(printf "%spx" $mediumw)}},
|
|
(max-width: {{(printf "%spx" $largew)}}) {{(printf "%spx" $largew)}},
|
|
100%
|
|
'
|
|
> |