half-size img
This commit is contained in:
@@ -15,6 +15,8 @@ care about is 700*4=2800px.
|
||||
{{ $j1400 := $src.Resize "1400x" }}
|
||||
{{ $j2800 := $src.Resize "2800x" }}
|
||||
|
||||
{{ $width := cond (eq (.Get "half") "true") "350px" "700px" }}
|
||||
|
||||
{{ with .Get "hint" }}
|
||||
{{ else }}
|
||||
{{ errorf "missing value for param 'hint': %s" .Position }}
|
||||
@@ -29,7 +31,7 @@ care about is 700*4=2800px.
|
||||
{{ with .Get "link" }}<a href="{{ . }}">{{ end }}
|
||||
<picture>
|
||||
<source type="image/webp"
|
||||
sizes="(max-width: 600px) 350px, 700px"
|
||||
sizes="(max-width: 600px) 350px, {{ $width }}"
|
||||
srcset='
|
||||
{{- if ge $src.Width "350" }}
|
||||
{{ with $w350.RelPermalink }}{{.}} 350w{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user