diff options
| author | Danilo M. <danix@danix.xyz> | 2026-06-26 17:16:10 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-06-26 17:16:10 +0200 |
| commit | 4e26aabccc2432b4670e874017f55261506d59bb (patch) | |
| tree | edc57ffa0e9ead025dcdc9ba8158fdb0853c742b | |
| parent | 5c03ea3fbe199c44505d1150b92a37bd09bca66c (diff) | |
| download | danixxyz-theme-4e26aabccc2432b4670e874017f55261506d59bb.tar.gz danixxyz-theme-4e26aabccc2432b4670e874017f55261506d59bb.zip | |
feat: slackware hub list layout with project rows
| -rw-r--r-- | layouts/partials/project-row.html | 65 | ||||
| -rw-r--r-- | layouts/slackware/list.html | 28 |
2 files changed, 93 insertions, 0 deletions
diff --git a/layouts/partials/project-row.html b/layouts/partials/project-row.html new file mode 100644 index 0000000..82a3481 --- /dev/null +++ b/layouts/partials/project-row.html @@ -0,0 +1,65 @@ +{{ $p := .page }} +{{ $reverse := eq (mod .index 2) 1 }} + +{{ $status := $p.Params.status | default "active" }} +{{/* status -> theme-aware bg/text var pair (all defined in main.css) */}} +{{ $bgVar := "--type-tech" }}{{ $txtVar := "--type-tech-text" }} +{{ if eq $status "maintained" }}{{ $bgVar = "--type-quote" }}{{ $txtVar = "--type-quote-text" }}{{ end }} +{{ if eq $status "wip" }}{{ $bgVar = "--type-life" }}{{ $txtVar = "--type-life-text" }}{{ end }} +{{ if eq $status "archived" }}{{ $bgVar = "--text-dim" }}{{ $txtVar = "--bg" }}{{ end }} + +{{ $imageURL := "" }} +{{ if $p.Params.image }} + {{ $res := $p.Resources.GetMatch $p.Params.image }} + {{ if $res }}{{ $imageURL = $res.RelPermalink }}{{ else }}{{ $imageURL = $p.Params.image }}{{ end }} +{{ end }} +{{ $glyph := substr (upper $p.Title) 0 2 }} + +<article class="group flex flex-col md:flex-row {{ if $reverse }}md:flex-row-reverse{{ end }} gap-6 items-stretch border-l-4 border-accent bg-surface/30 rounded-lg overflow-hidden transition-all duration-200 hover:-translate-y-1 hover:shadow-lg hover:bg-surface/50"> + <!-- Visual (decorative duplicate of the title link; hidden from AT) --> + <a href="{{ $p.RelPermalink }}" tabindex="-1" aria-hidden="true" class="md:w-1/3 flex-shrink-0 flex items-center justify-center bg-bg/40 min-h-[10rem]"> + {{ if $imageURL }} + <img src="{{ $imageURL }}" alt="" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-200" loading="lazy" /> + {{ else }} + <span class="text-5xl font-bold font-oxanium text-accent/80 select-none">{{ $glyph }}</span> + {{ end }} + </a> + + <!-- Body --> + <div class="flex-1 p-6 flex flex-col gap-3"> + <div class="flex items-start justify-between gap-3"> + <h2 class="text-2xl font-bold font-oxanium"> + <a href="{{ $p.RelPermalink }}" class="group-hover:text-accent transition-colors rounded focus:outline-none focus:ring-2 focus:ring-accent">{{ $p.Title }}</a> + </h2> + <span class="flex-shrink-0 px-3 py-1 rounded-full text-xs font-semibold" style="background-color: var({{ $bgVar }}); color: var({{ $txtVar }});"> + {{ i18n (printf "status-%s" $status) }} + </span> + </div> + + {{ with $p.Params.tagline }} + <p class="text-text-dim">{{ . }}</p> + {{ end }} + + {{ with $p.Params.tags }} + <ul class="flex flex-wrap gap-2 mt-1"> + {{ range . }} + <li class="px-2 py-1 rounded text-xs bg-bg/60 text-text">{{ . }}</li> + {{ end }} + </ul> + {{ end }} + + <div class="flex flex-wrap items-center gap-3 mt-auto pt-2"> + <a href="{{ $p.RelPermalink }}" class="btn btn-sm inline-flex items-center gap-2"> + {{ i18n "readMore" }} + <i data-feather="arrow-right" class="w-4 h-4" aria-hidden="true"></i> + </a> + {{ with $p.Params.repo_url }} + <a href="{{ . }}" target="_blank" rel="noopener noreferrer" class="text-sm text-text-dim hover:text-accent inline-flex items-center gap-1 transition-colors rounded focus:outline-none focus:ring-2 focus:ring-accent"> + {{ i18n "viewRepo" }} + <i data-feather="external-link" class="w-3 h-3" aria-hidden="true"></i> + <span class="sr-only">{{ i18n "opensInNewTab" }}</span> + </a> + {{ end }} + </div> + </div> +</article> diff --git a/layouts/slackware/list.html b/layouts/slackware/list.html new file mode 100644 index 0000000..e385f89 --- /dev/null +++ b/layouts/slackware/list.html @@ -0,0 +1,28 @@ +{{ define "main" }} +<section class="mx-auto px-4 py-12 max-w-5xl"> + <div class="content-grid"> + {{ partial "breadcrumb.html" . }} + + <div class="mb-10"> + <h1 class="text-5xl md:text-6xl font-bold mb-4 text-accent font-oxanium animate-fade-in"> + {{ i18n "slackwareTitle" }} + </h1> + <p class="text-xl text-text-dim animate-fade-in-delay"> + {{ i18n "slackwareSubtitle" }} + </p> + </div> + + {{ with .Content }} + <div class="prose dark:prose-invert max-w-none mb-12"> + {{ . }} + </div> + {{ end }} + + <div class="flex flex-col gap-8"> + {{ range $index, $p := .Pages }} + {{ partial "project-row.html" (dict "page" $p "index" $index) }} + {{ end }} + </div> + </div> +</section> +{{ end }} |
