diff options
| author | Danilo M. <danix@danix.xyz> | 2026-04-21 18:28:55 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-04-21 18:28:55 +0200 |
| commit | 8e16e9f4665f2537225f1d21668c6a8002745770 (patch) | |
| tree | f36f4785cd8d1920a20facf25c157687b7dddb6c /themes | |
| parent | 4e9a4a6483105d5eef1e3d769d6384c3af4ff4c9 (diff) | |
| download | danixxyz-8e16e9f4665f2537225f1d21668c6a8002745770.tar.gz danixxyz-8e16e9f4665f2537225f1d21668c6a8002745770.zip | |
fix: hide post-type badge and accents on static pages
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 <noreply@anthropic.com>
Diffstat (limited to 'themes')
| -rw-r--r-- | themes/danix-xyz-hacker/layouts/partials/article-header.html | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/themes/danix-xyz-hacker/layouts/partials/article-header.html b/themes/danix-xyz-hacker/layouts/partials/article-header.html index 16ebb8c..63b2a97 100644 --- a/themes/danix-xyz-hacker/layouts/partials/article-header.html +++ b/themes/danix-xyz-hacker/layouts/partials/article-header.html @@ -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 }} |
