Use dictionary to pass whether to use a secondaryColor for the badge.

This commit is contained in:
MaikelChan
2026-03-24 02:27:38 +01:00
parent 859685f0c2
commit 167ee1fa4c
3 changed files with 16 additions and 14 deletions
+2 -5
View File
@@ -103,11 +103,8 @@
{{ if .Params.showCategories | default (.Site.Params.article.showCategories | default true) }}
{{ if (eq $taxonomy "categories") }}
<a class="relative mt-[0.5rem] me-2" href="{{ .RelPermalink }}">
{{ if .Params.showCategoriesInSecondaryColor | default (.Site.Params.article.showCategoriesInSecondaryColor | default false) }}
{{ partial "badge-secondary.html" .LinkTitle }}
{{ else }}
{{ partial "badge.html" .LinkTitle }}
{{ end }}
{{ $useSecondaryColor := .Params.showCategoriesInSecondaryColor | default (.Site.Params.article.showCategoriesInSecondaryColor | default false) }}
{{ partial "badge.html" (dict "linkTitle" .LinkTitle "useSecondaryColor" $useSecondaryColor) }}
</a>
{{ end }}
{{ end }}