diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-22 12:43:22 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-22 12:43:22 +0200 |
| commit | 5b476f8905f411768e23cb01d577a60e5a5fd725 (patch) | |
| tree | 0a08cc83d809dbea714f52826e822501ee7c0165 /themes/danix-xyz-hacker/layouts/partials/article-card.html | |
| parent | 082e9246ffe453031894d32d3cee9d5d1bf2b67a (diff) | |
| download | danixxyz-5b476f8905f411768e23cb01d577a60e5a5fd725.tar.gz danixxyz-5b476f8905f411768e23cb01d577a60e5a5fd725.zip | |
chore: extract theme into git submodule (danix2-hugo-theme)
Diffstat (limited to 'themes/danix-xyz-hacker/layouts/partials/article-card.html')
| -rw-r--r-- | themes/danix-xyz-hacker/layouts/partials/article-card.html | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/themes/danix-xyz-hacker/layouts/partials/article-card.html b/themes/danix-xyz-hacker/layouts/partials/article-card.html deleted file mode 100644 index d803464..0000000 --- a/themes/danix-xyz-hacker/layouts/partials/article-card.html +++ /dev/null @@ -1,92 +0,0 @@ -{{ $articleType := .Params.type | default "life" }} -{{ $typeConfig := .Site.Params.articleTypes }} -{{ $typeData := index $typeConfig $articleType }} -{{ $excerpt := .Description | default .Summary }} - -{{ $imageURL := "" }} -{{ $useDefaultThumbnail := false }} -{{ if .Params.image }} - {{ $resource := .Resources.GetMatch .Params.image }} - {{ if $resource }} - {{ $imageURL = $resource.RelPermalink }} - {{ else }} - {{ $imageURL = .Params.image }} - {{ end }} -{{ else }} - {{ $useDefaultThumbnail = true }} -{{ end }} - -<article class="card group bg-bg"> - <!-- Thumbnail --> - {{ if or $imageURL $useDefaultThumbnail }} - <a href="{{ .RelPermalink }}" class="block overflow-hidden bg-surface/50 relative" tabindex="-1"> - {{ if $useDefaultThumbnail }} - <picture> - <source srcset="/images/default_thumbnail_light.png" media="(prefers-color-scheme: light)" /> - <img - src="/images/default_thumbnail_dark.png" - alt="{{ .Title }}" - class="card-image group-hover:scale-105 transition-transform duration-200" - loading="lazy" - /> - </picture> - {{ else }} - <img - src="{{ $imageURL }}" - alt="{{ .Title }}" - class="card-image group-hover:scale-105 transition-transform duration-200" - loading="lazy" - /> - {{ end }} - <!-- Type badge pill overlay --> - {{ if $typeData }} - <div - class="absolute top-3 right-3 px-3 py-1.5 rounded-full text-xs font-semibold transition-opacity" - style="background-color: var(--type-{{ $articleType }}); color: var(--type-{{ $articleType }}-text);" - > - {{ i18n $articleType }} - </div> - {{ end }} - </a> - {{ end }} - - <!-- Content --> - <div class="card-body"> - <!-- Pinned badge --> - {{ if .Params.pinned }} - <div class="inline-flex items-center gap-1 px-2 py-1 rounded text-sm font-semibold" style="color: {{ .Site.Params.secondaryAccent }};"> - 📌 PINNED - </div> - {{ end }} - - <!-- Title --> - <h3 class="text-xl font-semibold"> - <a href="{{ .RelPermalink }}" class="group-hover:text-accent transition-colors"> - {{ .Title }} - </a> - </h3> - - <!-- Metadata --> - <div class="flex flex-wrap items-center gap-3 text-sm text-text-dim"> - <time datetime="{{ .PublishDate.Format "2006-01-02T15:04:05Z07:00" }}"> - {{ .PublishDate.Format "Jan 2, 2006" }} - </time> - </div> - - <!-- Excerpt --> - {{ if $excerpt }} - <p class="text-text-dim text-sm line-clamp-3 leading-relaxed"> - {{ $excerpt | plainify }} - </p> - {{ end }} - - <!-- CTA Button --> - <a - href="{{ .RelPermalink }}" - class="btn btn-sm mt-2" - > - {{ i18n "readMore" }} - <i data-feather="arrow-right" class="w-4 h-4 ml-2"></i> - </a> - </div> -</article> |
