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-row.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'layouts/partials/project-row.html') 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