♻️ Refactor: image rendering aaa~again (#575)

This commit is contained in:
Cell
2025-03-07 12:18:40 +08:00
committed by GitHub
parent ad01016092
commit 8212d6fd02
18 changed files with 275 additions and 183 deletions
+9 -1
View File
@@ -137,12 +137,20 @@
{{- /* Featured image */ -}}
{{- $image := $params.featuredimage -}}
{{- with dict "Path" $image "Resources" .Resources | partial "function/resource.html" }}
{{- $image = .RelPermalink }}
{{- end }}
{{- with .Resources.GetMatch "featured-image" -}}
{{- $image = .RelPermalink -}}
{{- end -}}
{{- with $image -}}
<div class="featured-image">
{{- dict "Src" . "Title" $.Description | partial "plugin/image.html" -}}
{{- $optim := slice
(dict "Process" "resize 800x webp q75" "descriptor" "800w")
(dict "Process" "resize 1200x webp q75" "descriptor" "1200w")
(dict "Process" "resize 1600x webp q75" "descriptor" "1600w")
-}}
{{- dict "Src" . "Title" $.Description "OptimConfig" $optim | partial "plugin/image.html" -}}
</div>
{{- end -}}