update theme

This commit is contained in:
Ben Goldsworthy 2023-04-08 12:57:21 -06:00
parent 2a0ecfc3ec
commit f9aaff71c0
10 changed files with 1302 additions and 49 deletions

View file

@ -3,6 +3,9 @@
{{- end -}}
{{ $src := $.Page.Resources.GetMatch (.Get "src") }}
{{ if ( not $src ) }}
{{- errorf "No Page Resource found for src '%v' for post '%v'" ( .Get "src" ) $.Page.Title -}}
{{ end }}
{{ $linkedResource := $.Page.Resources.GetMatch (.Get "link") }}
<figure class="article__figure{{ with .Get "class" }} {{ . }}{{ end }}">
@ -34,15 +37,19 @@
{{- if eq $src.ResourceType "image" -}}
<picture class="figure__picture">
<img class="figure__image"
{{ with $src.Resize "1500x webp" }}
src="{{ .RelPermalink }}"
{{ if eq $src.MediaType.SubType "svg" }}
src="{{ $src.RelPermalink }}"
{{ else }}
{{ with $src.Resize "1500x webp" }}
src="{{ .RelPermalink }}"
{{ end }}
width="{{ $src.Width }}"
height="{{ $src.Height }}"
{{ end }}
{{- if or ($src.Params.alt) (.Get "caption") }}
alt="{{ with $src.Params.alt }}{{ . }}{{ else }}{{ .Get "caption" | markdownify | plainify }}{{ end }}"
{{- end -}}
{{- with $src.Params.title }} title="{{ . }}"{{ end -}}
width="{{ $src.Width }}"
height="{{ $src.Height }}"
/>
</picture>
{{- else if eq $src.ResourceType "video" -}}