diff --git a/layouts/partials/article-meta/basic.html b/layouts/partials/article-meta/basic.html
index 9fe54277..d83c703d 100644
--- a/layouts/partials/article-meta/basic.html
+++ b/layouts/partials/article-meta/basic.html
@@ -103,11 +103,8 @@
{{ if .Params.showCategories | default (.Site.Params.article.showCategories | default true) }}
{{ if (eq $taxonomy "categories") }}
- {{ 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) }}
{{ end }}
{{ end }}
diff --git a/layouts/partials/badge-secondary.html b/layouts/partials/badge-secondary.html
deleted file mode 100644
index a8bf7499..00000000
--- a/layouts/partials/badge-secondary.html
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
- {{ . }}
-
-
\ No newline at end of file
diff --git a/layouts/partials/badge.html b/layouts/partials/badge.html
index e97bf399..bcc10ac1 100644
--- a/layouts/partials/badge.html
+++ b/layouts/partials/badge.html
@@ -1,6 +1,17 @@
-
- {{ . }}
+ {{ $linkTitle := . }}
+ {{ $useSecondaryColor := false }}
+ {{ if (reflect.IsMap . ) }}
+ {{ $linkTitle = .linkTitle }}
+ {{ $useSecondaryColor = cond (not .useSecondaryColor) false .useSecondaryColor }}
+ {{ end }}
+ {{ if $useSecondaryColor }}
+
+ {{ else }}
+
+ {{ end }}
+ {{ $linkTitle }}