mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 15:31:52 +00:00
Revert "♻️ Refactor: Move inline styles containing background-image: out of line"
This reverts commit 1736cafcf4.
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user