feat: add image processing, improvements

This commit is contained in:
2026-02-12 22:57:49 +01:00
parent fb791102f7
commit 297fbf41a4
8 changed files with 55 additions and 11 deletions

View File

@@ -1,15 +1,21 @@
{{- $page := . -}}
{{- $image := "" }}
{{- with $page.Params.headerimage }}
<div class="header-image">
{{- if eq $page.BundleType "leaf" }}
{{- with $page.Resources.GetMatch .src }}
<img src="{{ .RelPermalink }}" />
{{- $image = . }}
{{- end }}
{{- else }}
{{- with resources.GetMatch (printf "**/%s" .src) }}
<img src="{{ .RelPermalink }}" />
{{- $image = . }}
{{- end }}
{{- end }}
{{- $processes := .processes | default (slice "fill 1000x440 webp" )}}
{{- $image = partial "image-processing" (dict "image" $image "processes" $processes "filter" .filter) -}}
{{- with $image }}
<img src="{{ .RelPermalink }}" />
{{- end }}
{{- with .text }}<p>{{ . | markdownify }}</p>{{ end }}
</div>
{{- end }}