]> danix's work - danix.xyz-2.git/commitdiff
fix: hide post-type badge and accents on static pages
authorDanilo M. <redacted>
Tue, 21 Apr 2026 16:28:55 +0000 (18:28 +0200)
committerDanilo M. <redacted>
Tue, 21 Apr 2026 16:28:55 +0000 (18:28 +0200)
Only show type badge, vertical accent line, and horizontal accent line on
articles with explicit type front matter. Static pages (is/ section) no longer
display the "Life" default badge. Updated badge styling to use inline
background-color with full type color variable, matching card overlay appearance.

Co-Authored-By: Claude Haiku 4.5 <redacted>
TODO.md
themes/danix-xyz-hacker/layouts/partials/article-header.html

diff --git a/TODO.md b/TODO.md
index 1707a09cee6e0e1ad24d8c03bc8370066c2a8a2e..41698e10b45682752e3db5b7a51fc11643d805b1 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -18,6 +18,7 @@
 - [✅] add back-to-top button
 - [✅] Lazy loading articles in list view
 - [✅] modify articles list view to be more of a timeline (line in middle, articles on sides)
+- [✅] remove article type labels from static pages
 - [ ] Progressive enhancement (offline support)
 - [⏳] Create accessibility badges component (WCAG 2.1 AA, Keyboard Accessible, Screen Reader Compatible)
 - [ ] Add badges to footer with links to A11Y-AUDIT-REPORT.md
index 16ebb8cdd1957e7bbb50a4f715eb2b71deaac6a0..63b2a97242bb05fd7057ab2835da03301b25394d 100644 (file)
@@ -1,12 +1,13 @@
 {{ $articleType := .Params.type | default "life" }}
 {{ $typeConfig := .Site.Params.articleTypes }}
 {{ $typeData := index $typeConfig $articleType }}
+{{ $hasType := .Params.type }}
 
 <div class="mb-8 pb-8 border-b border-border">
   <!-- Title with accent corner -->
   <div class="relative mb-6">
     <!-- Vertical accent line (left side) -->
-    {{ if $typeData }}
+    {{ if and $typeData $hasType }}
     <div
       class="absolute left-0 top-0 bottom-0 w-1 rounded-full"
       style="background-color: var(--type-{{ $articleType }});"
@@ -14,7 +15,7 @@
     {{ end }}
 
     <!-- Horizontal accent line (bottom, 50% width with fade) -->
-    {{ if $typeData }}
+    {{ if and $typeData $hasType }}
     <div
       class="absolute left-0 bottom-0 h-1 rounded-full"
       style="width: 50%; background: linear-gradient(to right, var(--type-{{ $articleType }}), var(--type-{{ $articleType }}) 0%, transparent 100%);"
@@ -61,8 +62,8 @@
     {{ end }}
 
     <!-- Type badge -->
-    {{ if $typeData }}
-    <span class="badge badge-{{ $articleType }}">
+    {{ if and $typeData $hasType }}
+    <span class="inline-flex items-center px-2.5 py-1 rounded text-sm font-mono font-semibold whitespace-nowrap transition-all duration-200 text-white" style="background-color: var(--type-{{ $articleType }}); border: 1px solid var(--type-{{ $articleType }});">
       {{ i18n $articleType }}
     </span>
     {{ end }}