summaryrefslogtreecommitdiffstats
path: root/layouts/partials/project-header.html
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-06-26 18:13:36 +0200
committerDanilo M. <danix@danix.xyz>2026-06-26 18:13:36 +0200
commit9073908fb5e33c895b162d0418d6e67246af539e (patch)
treed8beaa5f5c58eacee91870af7a7cdcc94b2fff7a /layouts/partials/project-header.html
parent91eeea0d6b61b652a0bc3b16a137609da59da69f (diff)
parent9244ad0666c4859569801508348fa83c6e4648f4 (diff)
downloaddanixxyz-theme-9073908fb5e33c895b162d0418d6e67246af539e.tar.gz
danixxyz-theme-9073908fb5e33c895b162d0418d6e67246af539e.zip
Merge slackware-projects: project pages, submenu, image roles
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'layouts/partials/project-header.html')
-rw-r--r--layouts/partials/project-header.html45
1 files changed, 45 insertions, 0 deletions
diff --git a/layouts/partials/project-header.html b/layouts/partials/project-header.html
new file mode 100644
index 0000000..17fe7db
--- /dev/null
+++ b/layouts/partials/project-header.html
@@ -0,0 +1,45 @@
+{{ $status := .Params.status | default "active" }}
+{{/* status -> theme-aware bg/text var pair (all defined in main.css).
+ active=green, maintained=blue, wip=amber, archived=muted. */}}
+{{ $bgVar := "--type-quote" }}{{ $txtVar := "--type-quote-text" }}
+{{ if eq $status "maintained" }}{{ $bgVar = "--type-link" }}{{ $txtVar = "--type-link-text" }}{{ end }}
+{{ if eq $status "wip" }}{{ $bgVar = "--type-life" }}{{ $txtVar = "--type-life-text" }}{{ end }}
+{{ if eq $status "archived" }}{{ $bgVar = "--text-dim" }}{{ $txtVar = "--bg" }}{{ end }}
+{{ $badgeStyle := printf "background-color: var(%s); color: var(%s);" $bgVar $txtVar | safeCSS }}
+
+{{/* Full-width banner: page resource named header.* in the project bundle. */}}
+{{ $headerImg := .Resources.GetMatch "header.*" }}
+
+<header class="mb-10">
+ {{ with $headerImg }}
+ <img src="{{ .RelPermalink }}" alt="" class="w-full h-48 md:h-64 object-cover rounded-lg mb-6" loading="lazy" />
+ {{ end }}
+
+ <div class="flex flex-wrap items-center justify-between gap-3 mb-2">
+ <h1 class="text-4xl md:text-5xl font-bold text-accent font-oxanium">{{ .Title }}</h1>
+ <span class="flex-shrink-0 px-3 py-1 rounded-full text-xs font-semibold" style="{{ $badgeStyle }}">
+ {{ i18n (printf "status-%s" $status) }}
+ </span>
+ </div>
+
+ {{ with .Params.tagline }}
+ <p class="text-xl text-text-dim mb-4">{{ . }}</p>
+ {{ end }}
+
+ <div class="flex flex-wrap items-center justify-between gap-3">
+ {{ with .Params.repo_url }}
+ <a href="{{ . }}" target="_blank" rel="noopener noreferrer" class="btn btn-sm inline-flex items-center gap-2">
+ {{ i18n "viewRepo" }}
+ <i data-feather="external-link" class="w-4 h-4" aria-hidden="true"></i>
+ <span class="sr-only">{{ i18n "opensInNewTab" }}</span>
+ </a>
+ {{ end }}
+ {{ with .Params.tags }}
+ <ul class="flex flex-wrap gap-2 ml-auto">
+ {{ range . }}
+ <li><a href="/tags/{{ . | urlize }}/" class="px-2 py-1 rounded text-xs bg-surface text-text hover:text-accent transition-colors focus:outline-none focus:ring-2 focus:ring-accent">{{ . }}</a></li>
+ {{ end }}
+ </ul>
+ {{ end }}
+ </div>
+</header>