1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-19 12:35:31 -04:00

make optimize-image more function-like

....instead of relying on $.Scratch
This commit is contained in:
2020-01-15 10:30:01 -05:00
parent 827ffd20e3
commit f51e912632
7 changed files with 48 additions and 46 deletions

View File

@@ -3,10 +3,10 @@
<p class="image">
<amp-img
{{- with .Get "alt" }} alt="{{ . | safeHTML }}" title="{{ . | safeHTML }}"{{ else }}
{{- with .Inner }} alt="{{ . | markdownify | plainify | safeHTML }}" title="{{ . | markdownify | plainify | safeHTML }}"{{ end }}{{ end }}
{{- with .Inner }} alt="{{ . | $.Page.RenderString | plainify | safeHTML }}" title="{{ . | $.Page.RenderString | plainify | safeHTML }}"{{ end }}{{ end }}
src="{{ $optimized.Permalink }}"
width="{{ .Scratch.Get "displayWidth" }}"
height="{{ .Scratch.Get "displayHeight" }}"
width="{{ $optimized.Width }}"
height="{{ $optimized.Height }}"
layout="intrinsic">
</amp-img>
</p>