Revert "♻️ Refactor: Move inline styles containing background-image: out of line"

This reverts commit 1736cafcf4.
This commit is contained in:
ZhenShuo Leo
2025-07-11 09:02:44 +08:00
parent 8d05df18dc
commit 9e5a7f9d29
8 changed files with 272 additions and 272 deletions
+20 -17
View File
@@ -1,29 +1,32 @@
<a href="{{ .Page.RelPermalink }}" class="min-w-full">
<div
class="border border-neutral-200 dark:border-neutral-700 border-2 rounded overflow-hidden shadow-2xl relative">
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
{{- with site.Params.images -}}
{{- range first 6 . }}
<meta property="og:image" content="{{ . | absURL }}">
{{ end -}}
{{- else -}}
{{ $images := .Page.Resources.ByType "image" }}
{{ $featuredImage := $images.GetMatch "*feature*" }}
{{ if not $featuredImage }}
{{ $featuredImage = $images.GetMatch "{*cover*,*thumbnail*}" }}
{{ end }}
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
{{ if and ($featuredImage) (not (or ($disableImageOptimization) (strings.HasSuffix $featuredImage.Name ".svg"))) }}
{{ $featuredImage = $featuredImage.Resize "600x" }}
{{ end }}
{{ with $featuredImage }}
{{ $className := printf "background-image-%s" (md5 .RelPermalink) }}
<div class="w-full thumbnail_card_related nozoom {{ $className }}"></div>
{{ else }}
{{ with site.Params.images }}
<meta property="og:image" content="{{ index . 0 | absURL }}" />
{{- $images := .Page.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- 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 }}
{{ end }}
{{- else -}}
{{- with site.Params.images }}
<meta property="og:image" content="{{ index . 0 | absURL }}">
{{ end -}}
{{- end -}}
{{- end -}}
{{ if site.Params.taxonomy.showTermCount | default true }}
<span class="absolute bottom-0 right-0 m-2">