diff options
| author | Danilo M. <danix@danix.xyz> | 2026-06-26 17:13:04 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-06-26 17:13:04 +0200 |
| commit | 1520f2065a67a14eaef56233b337fe4c02622b03 (patch) | |
| tree | e5760b3cf69fea3ed0b69532d931cc2c06b7e5d4 | |
| parent | 78b872fcf0cd7b73d335a6208d2bd381897a4e33 (diff) | |
| download | danixxyz-theme-1520f2065a67a14eaef56233b337fe4c02622b03.tar.gz danixxyz-theme-1520f2065a67a14eaef56233b337fe4c02622b03.zip | |
feat: slackware project single layout with project-header partial
| -rw-r--r-- | layouts/partials/project-header.html | 46 | ||||
| -rw-r--r-- | layouts/slackware/single.html | 17 |
2 files changed, 63 insertions, 0 deletions
diff --git a/layouts/partials/project-header.html b/layouts/partials/project-header.html new file mode 100644 index 0000000..c727458 --- /dev/null +++ b/layouts/partials/project-header.html @@ -0,0 +1,46 @@ +{{ $status := .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 .Params.image }} + {{ $res := .Resources.GetMatch .Params.image }} + {{ if $res }}{{ $imageURL = $res.RelPermalink }}{{ else }}{{ $imageURL = .Params.image }}{{ end }} +{{ end }} + +<header class="mb-10"> + {{ if $imageURL }} + <img src="{{ $imageURL }}" alt="{{ .Title }}" class="w-24 h-24 object-contain rounded-lg mb-4 bg-surface/50" loading="lazy" /> + {{ end }} + + <div class="flex flex-wrap items-center gap-3 mb-2"> + <h1 class="text-4xl md:text-5xl font-bold text-accent font-oxanium">{{ .Title }}</h1> + <span class="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 .Params.tagline }} + <p class="text-xl text-text-dim mb-4">{{ . }}</p> + {{ end }} + + <div class="flex flex-wrap items-center 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"> + {{ 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> diff --git a/layouts/slackware/single.html b/layouts/slackware/single.html new file mode 100644 index 0000000..e1178c7 --- /dev/null +++ b/layouts/slackware/single.html @@ -0,0 +1,17 @@ +{{ define "main" }} +<article class="mx-auto px-4 py-12 max-w-4xl"> + <div class="content-grid"> + {{ partial "breadcrumb.html" . }} + + {{ partial "project-header.html" . }} + + <div class="prose dark:prose-invert max-w-none mb-12"> + {{ .Content }} + </div> + + <div class="mb-12"> + {{ partial "social-share.html" (dict "page" . "mode" "inline") }} + </div> + </div> +</article> +{{ end }} |
