mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-19 12:15:34 -04:00
change a BUNCH of if's to with's to prepare for theme extraction
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
{{- $retinaWidth := (mul $setWidth 2) -}}
|
||||
|
||||
{{- if gt $original.Width $retinaWidth -}}
|
||||
{{- $finalWidth := (printf "%dx" $retinaWidth ) -}}
|
||||
{{- $finalWidth := (printf "%dx" $retinaWidth) -}}
|
||||
{{- .Scratch.Set "image" ($original.Resize $finalWidth) -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
@@ -28,13 +28,12 @@
|
||||
|
||||
<p class="image">
|
||||
<amp-img
|
||||
alt="{{ .Get "alt" }}"
|
||||
{{ with .Get "alt" }}alt="{{ . }}"{{ end }}
|
||||
src="{{ $image.Permalink }}"
|
||||
width="{{ $displayWidth }}"
|
||||
height="{{ $displayHeight }}"
|
||||
layout="intrinsic"
|
||||
>
|
||||
layout="intrinsic">
|
||||
</amp-img>
|
||||
</p>
|
||||
|
||||
{{- with (.Get "caption") }}<p class="caption"><em>{{ . }}</em></p>{{ end -}}
|
||||
{{- with .Get "caption" }}<p class="caption"><em>{{ . }}</em></p>{{ end -}}
|
||||
|
Reference in New Issue
Block a user