1
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:
2019-12-03 12:41:55 -05:00
parent ac0bbc6343
commit 96ad258d36
23 changed files with 153 additions and 104 deletions

View File

@@ -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 -}}