mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-10-10 22:09:31 +00:00
Floating glass header with ⌘K search, landing homepage layout with hero image and GitHub-stars CTA, background canvas with dissolving heroes, burufugu colour scheme, movie-quote 404, taxonomy pills, keyboard/ARIA accessibility across menus, search and tabs, idle- loaded third-party scripts, and dedicated print styles. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
121 lines
4.6 KiB
HTML
121 lines
4.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 := site.Store.Get "disableImageOptimization" }}
|
|
|
|
{{ $page := .Page }}
|
|
{{ $featured := "" }}
|
|
{{ $featuredURL := "" }}
|
|
{{ $thumbnailAspectRatio := site.Params.thumbnailAspectRatio | default "1.5" }}
|
|
{{ $thumbnailAspectRatio = replaceRE "[^0-9.]" "" $thumbnailAspectRatio }}
|
|
{{ if eq $thumbnailAspectRatio "" }}{{ $thumbnailAspectRatio = "1.5" }}{{ end }}
|
|
{{ $featureImageHover := site.Params.list.featureImageHover | default false }}
|
|
{{ if isset .Params "featureImageHover" }}{{ $featureImageHover = .Params.featureImageHover }}{{ end }}
|
|
{{ $featureImagePosition := .Params.imagePositionFeature | default site.Params.imagePositionFeature | default site.Params.imagePosition }}
|
|
{{ if not .Params.hideFeatureImage }}
|
|
{{/* frontmatter */}}
|
|
{{ with $page }}
|
|
{{ $p := . }}
|
|
{{ with partial "functions/feature-image.html" . }}
|
|
{{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }}
|
|
{{ if site.Params.hotlinkFeatureImage }}
|
|
{{ $featuredURL = . }}
|
|
{{ else }}
|
|
{{ $featured = resources.GetRemote . }}
|
|
{{ end }}
|
|
{{ else }}
|
|
{{ $featured = $p.Resources.Get . }}
|
|
{{ if not $featured }}
|
|
{{ $featured = resources.Get . }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{/* page resources */}}
|
|
{{ if not (or $featured $featuredURL) }}
|
|
{{ $images := .Resources.ByType "image" }}
|
|
{{ range slice "*feature*" "*cover*" "*thumbnail*" }}
|
|
{{ if not $featured }}{{ $featured = $images.GetMatch . }}{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{/* fallback to default */}}
|
|
{{ if not (or $featured $featuredURL) }}
|
|
{{ $default := site.Store.Get "defaultFeaturedImage" }}
|
|
{{ if $default.url }}
|
|
{{ $featuredURL = $default.url }}
|
|
{{ else if $default.obj }}
|
|
{{ $featured = $default.obj }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{/* generate image URL if not hotlink */}}
|
|
{{ if not $featuredURL }}
|
|
{{ with $featured }}
|
|
{{ $featuredURL = .RelPermalink }}
|
|
{{ if not (or $disableImageOptimization (eq .MediaType.SubType "svg")) }}
|
|
{{ with try (.Resize "600x") }}
|
|
{{ with .Value }}{{ $featuredURL = .RelPermalink }}{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
|
|
<article
|
|
class="article-link--card group relative min-h-full min-w-full overflow-hidden rounded-lg border border-neutral-300/80 bg-white/60 backdrop-blur-xl dark:border-neutral-600/80 dark:bg-neutral-900/50">
|
|
{{ with $featuredURL }}
|
|
<div
|
|
class="flex-none relative overflow-hidden thumbnail_card"
|
|
style="--thumbnail-aspect-ratio: {{ $thumbnailAspectRatio }}">
|
|
<img
|
|
src="{{ . }}"
|
|
alt="{{ $page.Title }}"
|
|
loading="lazy"
|
|
decoding="async"
|
|
fetchpriority="low"
|
|
class="not-prose absolute inset-0 h-full w-full object-cover transition-transform duration-700 ease-[cubic-bezier(0.22,1,0.36,1)] {{ if $featureImageHover }}group-hover:scale-[1.03]{{ end }}"
|
|
{{ with $featureImagePosition }}style="object-position: {{ . }};"{{ end }} />
|
|
</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="p-4">
|
|
<header>
|
|
<a
|
|
{{ with $page.Params.externalUrl }}
|
|
href="{{ . }}" target="_blank" rel="external"
|
|
{{ else }}
|
|
href="{{ $page.RelPermalink }}"
|
|
{{ end }}
|
|
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="article-link__summary prose dark:prose-invert mt-1 line-clamp-5">
|
|
{{ .Summary | plainify }}
|
|
</div>
|
|
{{ end }}
|
|
</div>
|
|
<div class="px-6 pt-4 pb-2"></div>
|
|
</article>
|