chore(term-link): remove unused .Params.images

This commit is contained in:
ZhenShuo Leo
2025-08-31 22:43:51 +08:00
parent cb479d5693
commit 8911ac843a

View File

@@ -1,31 +1,21 @@
<a href="{{ .Page.RelPermalink }}" class="min-w-full"> <a href="{{ .Page.RelPermalink }}" class="min-w-full">
<div <div
class="border border-neutral-200 dark:border-neutral-700 border-2 rounded overflow-hidden shadow-2xl relative"> class="border-neutral-200 dark:border-neutral-700 border-2 rounded overflow-hidden shadow-2xl relative">
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }} {{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
{{- with site.Params.images -}} {{- $images := .Page.Resources.ByType "image" -}}
{{- range first 6 . }} {{- $featured := $images.GetMatch "*feature*" -}}
<meta property="og:image" content="{{ . | absURL }}"> {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{ end -}} {{- with $featured -}}
{{- else -}} {{ if $disableImageOptimization }}
{{- $images := .Page.Resources.ByType "image" -}} {{ with . }}
{{- $featured := $images.GetMatch "*feature*" -}} <div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- with $featured -}}
{{ if $disableImageOptimization }}
{{ with . }}
<div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ else }}
{{ with .Resize "600x" }}
<div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end }}
{{ end }} {{ end }}
{{- else -}} {{ else }}
{{- with site.Params.images }} {{ with .Resize "600x" }}
<meta property="og:image" content="{{ index . 0 | absURL }}"> <div class="w-full thumbnail_card nozoom" style="background-image:url({{ .RelPermalink }});"></div>
{{ end -}} {{ end }}
{{- end -}} {{ end }}
{{- end -}} {{- end -}}
{{ if site.Params.taxonomy.showTermCount | default true }} {{ if site.Params.taxonomy.showTermCount | default true }}