mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
73 lines
2.6 KiB
HTML
73 lines
2.6 KiB
HTML
{{/* Used by
|
|
1. list.html and term.html (when the cardView option is enabled)
|
|
2. Recent articles template (when the cardView option is enabled)
|
|
3. Shortcode list.html
|
|
*/}}
|
|
{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
|
|
|
|
{{ $featured := "" }}
|
|
{{ $featuredURL := "" }}
|
|
{{ if not .Params.hideFeatureImage }}
|
|
{{ with .Params.featureimage }}
|
|
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
|
|
{{ $featured = resources.GetRemote . }}
|
|
{{ else }}
|
|
{{ $featured = resources.Get . }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ if not $featured }}
|
|
{{ $images := $.Resources.ByType "image" }}
|
|
{{ range slice "*feature*" "*cover*" "*thumbnail*" }}
|
|
{{ if not $featured }}{{ $featured = $images.GetMatch . }}{{ end }}
|
|
{{ end }}
|
|
{{ if not $featured }}
|
|
{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ with $featured }}
|
|
{{ $featuredURL = .RelPermalink }}
|
|
{{ if not (or $disableImageOptimization (eq .MediaType.SubType "svg")) }}
|
|
{{ $featuredURL = (.Resize "600x").RelPermalink }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
|
|
<article
|
|
class="relative min-h-full min-w-full overflow-hidden rounded border border-2 border-neutral-200 shadow-2xl dark:border-neutral-700">
|
|
{{ with $featuredURL }}
|
|
<div class="thumbnail_card nozoom w-full" style="background-image:url({{ . }});"></div>
|
|
{{ 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">
|
|
<header>
|
|
<a
|
|
{{ partial "article-link/_external-link.html" . | safeHTMLAttr }}
|
|
class="not-prose before:absolute before:inset-0 decoration-primary-500 dark:text-neutral text-xl font-bold text-neutral-800 hover:underline hover:underline-offset-2">
|
|
<h2>
|
|
{{ .Title | emojify }}
|
|
{{ if .Params.externalUrl }}
|
|
<span class="cursor-default align-top text-xs text-neutral-400 dark:text-neutral-500">
|
|
<span class="rtl:hidden">↗</span>
|
|
<span class="ltr:hidden">↖</span>
|
|
</span>
|
|
{{ end }}
|
|
</h2>
|
|
</a>
|
|
</header>
|
|
<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="prose dark:prose-invert py-1">{{ .Summary | plainify }}</div>
|
|
{{ end }}
|
|
</div>
|
|
<div class="px-6 pt-4 pb-2"></div>
|
|
</article>
|