From 1520f2065a67a14eaef56233b337fe4c02622b03 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 26 Jun 2026 17:13:04 +0200 Subject: feat: slackware project single layout with project-header partial --- layouts/partials/project-header.html | 46 ++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 layouts/partials/project-header.html (limited to 'layouts/partials/project-header.html') 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 }} + +
+ {{ if $imageURL }} + {{ .Title }} + {{ end }} + +
+

{{ .Title }}

+ + {{ i18n (printf "status-%s" $status) }} + +
+ + {{ with .Params.tagline }} +

{{ . }}

+ {{ end }} + +
+ {{ with .Params.repo_url }} + + {{ i18n "viewRepo" }} + + {{ i18n "opensInNewTab" }} + + {{ end }} + {{ with .Params.tags }} +
    + {{ range . }} +
  • {{ . }}
  • + {{ end }} +
+ {{ end }} +
+
-- cgit v1.2.3 From 43edbdb66bc6c8e80deb1b67b688acba21286534 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 26 Jun 2026 17:42:58 +0200 Subject: fix: status badge color (safeCSS) + right-align badge and tags Hugo escaped the CSS-var style to ZgotmplZ, so badge colors never applied; build the style string through safeCSS instead. active=green now. On the project page, right-align the status badge with the title and push tags to the right, matching the list-view layout. --- layouts/partials/project-header.html | 16 +++++++++------- layouts/partials/project-row.html | 10 ++++++---- 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'layouts/partials/project-header.html') diff --git a/layouts/partials/project-header.html b/layouts/partials/project-header.html index c727458..f153a26 100644 --- a/layouts/partials/project-header.html +++ b/layouts/partials/project-header.html @@ -1,9 +1,11 @@ {{ $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 }} +{{/* 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 }} {{ $imageURL := "" }} {{ if .Params.image }} @@ -16,9 +18,9 @@ {{ .Title }} {{ end }} -
+

{{ .Title }}

- + {{ i18n (printf "status-%s" $status) }}
@@ -27,7 +29,7 @@

{{ . }}

{{ end }} -
+
{{ with .Params.repo_url }} {{ i18n "viewRepo" }} @@ -36,7 +38,7 @@ {{ end }} {{ with .Params.tags }} -
    +
      {{ range . }}
    • {{ . }}
    • {{ end }} diff --git a/layouts/partials/project-row.html b/layouts/partials/project-row.html index 82a3481..89662ee 100644 --- a/layouts/partials/project-row.html +++ b/layouts/partials/project-row.html @@ -2,11 +2,13 @@ {{ $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 }} +{{/* 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 }} {{ $imageURL := "" }} {{ if $p.Params.image }} @@ -31,7 +33,7 @@

      {{ $p.Title }}

      - + {{ i18n (printf "status-%s" $status) }}
-- cgit v1.2.3 From f5e6e6ecb2fa0dee24b701e53daebaac677687f3 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 26 Jun 2026 17:55:30 +0200 Subject: feat: infer thumbnail.* (2:3 row) and header.* (wide banner) page resources Row uses a thumbnail.* page resource; project page shows a full-width header.* banner above the title instead of a small inline logo. Both inferred by filename from the project bundle, no front-matter needed (image param kept as thumbnail fallback). --- layouts/partials/project-header.html | 11 ++++------- layouts/partials/project-row.html | 7 ++++++- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'layouts/partials/project-header.html') diff --git a/layouts/partials/project-header.html b/layouts/partials/project-header.html index f153a26..17fe7db 100644 --- a/layouts/partials/project-header.html +++ b/layouts/partials/project-header.html @@ -7,15 +7,12 @@ {{ if eq $status "archived" }}{{ $bgVar = "--text-dim" }}{{ $txtVar = "--bg" }}{{ end }} {{ $badgeStyle := printf "background-color: var(%s); color: var(%s);" $bgVar $txtVar | safeCSS }} -{{ $imageURL := "" }} -{{ if .Params.image }} - {{ $res := .Resources.GetMatch .Params.image }} - {{ if $res }}{{ $imageURL = $res.RelPermalink }}{{ else }}{{ $imageURL = .Params.image }}{{ end }} -{{ end }} +{{/* Full-width banner: page resource named header.* in the project bundle. */}} +{{ $headerImg := .Resources.GetMatch "header.*" }}
- {{ if $imageURL }} - {{ .Title }} + {{ with $headerImg }} + {{ end }}
diff --git a/layouts/partials/project-row.html b/layouts/partials/project-row.html index 89662ee..5a65f35 100644 --- a/layouts/partials/project-row.html +++ b/layouts/partials/project-row.html @@ -10,8 +10,13 @@ {{ if eq $status "archived" }}{{ $bgVar = "--text-dim" }}{{ $txtVar = "--bg" }}{{ end }} {{ $badgeStyle := printf "background-color: var(%s); color: var(%s);" $bgVar $txtVar | safeCSS }} +{{/* Row thumbnail (2:3): page resource named thumbnail.* in the project + bundle; fall back to an `image` param, else a mono-glyph block. */}} {{ $imageURL := "" }} -{{ if $p.Params.image }} +{{ $thumb := $p.Resources.GetMatch "thumbnail.*" }} +{{ if $thumb }} + {{ $imageURL = $thumb.RelPermalink }} +{{ else if $p.Params.image }} {{ $res := $p.Resources.GetMatch $p.Params.image }} {{ if $res }}{{ $imageURL = $res.RelPermalink }}{{ else }}{{ $imageURL = $p.Params.image }}{{ end }} {{ end }} -- cgit v1.2.3