mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
78 lines
3.0 KiB
HTML
78 lines
3.0 KiB
HTML
<a {{ partial "article-link/_external-link.html" . | safeHTMLAttr }} class="min-w-full">
|
|
<div
|
|
class="min-h-full border border-neutral-200 dark:border-neutral-700 border-2 rounded overflow-hidden shadow-2xl relative">
|
|
{{- with $.Params.images -}}
|
|
{{- range first 6 . }}
|
|
<meta property="og:image" content="{{ . | absURL }}">
|
|
{{ end -}}
|
|
{{- else -}}
|
|
{{ $images := $.Resources.ByType "image" }}
|
|
{{ $featuredImage := $images.GetMatch "*feature*" }}
|
|
{{ if not $featuredImage }}
|
|
{{ $featuredImage = $images.GetMatch "{*cover*,*thumbnail*}" }}
|
|
{{ end }}
|
|
{{ if and (not $featuredImage) .Params.featureimage }}
|
|
{{ $featuredImage = resources.GetRemote .Params.featureimage }}
|
|
{{ end }}
|
|
{{ if not $featuredImage }}
|
|
{{ $featuredImage = resources.Get .Site.Params.defaultFeaturedImage }}
|
|
{{ end }}
|
|
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
|
|
{{ if and ($featuredImage) (not (or ($disableImageOptimization) (strings.HasSuffix $featuredImage.Name ".svg"))) }}
|
|
{{ $featuredImage = $featuredImage.Resize "600x" }}
|
|
{{ end }}
|
|
{{ if .Params.hideFeatureImage }}
|
|
{{ $featuredImage = false }}
|
|
{{ end }}
|
|
{{ with $featuredImage }}
|
|
{{ $className := printf "background-image-%s" (md5 .RelPermalink) }}
|
|
<div class="w-full thumbnail_card nozoom {{ $className }}"></div>
|
|
{{ else }}
|
|
{{ with $.Site.Params.images }}
|
|
<meta property="og:image" content="{{ index . 0 | absURL }}">
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ if and .Draft .Site.Params.article.showDraftLabel }}
|
|
<span class="absolute top-0 right-0 m-2">
|
|
{{ partial "badge.html" (i18n "article.draft" | emojify) }}
|
|
</span>
|
|
{{ end }}
|
|
|
|
|
|
<div class="px-6 py-4">
|
|
{{ with .Params.externalUrl }}
|
|
<div>
|
|
<div
|
|
class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral">
|
|
{{ $.Title | emojify }}
|
|
<span class="text-xs align-top cursor-default text-neutral-400 dark:text-neutral-500">
|
|
<span class="rtl:hidden">↗</span>
|
|
<span class="ltr:hidden">↖</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
{{ else }}
|
|
<div
|
|
class="font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral"
|
|
href="{{ .RelPermalink }}">
|
|
{{ .Title | emojify }}
|
|
</div>
|
|
{{ end }}
|
|
|
|
|
|
<div class="text-sm text-neutral-500 dark:text-neutral-400">
|
|
{{ partial "article-meta/basic.html" . }}
|
|
</div>
|
|
|
|
{{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }}
|
|
<div class="py-1 prose dark:prose-invert">
|
|
{{ .Summary | plainify }}
|
|
</div>
|
|
{{ end }}
|
|
</div>
|
|
<div class="px-6 pt-4 pb-2"></div>
|
|
</div>
|
|
</a>
|