Use dictionary to pass whether to use a secondaryColor for the badge.
This commit is contained in:
@@ -103,11 +103,8 @@
|
|||||||
{{ if .Params.showCategories | default (.Site.Params.article.showCategories | default true) }}
|
{{ if .Params.showCategories | default (.Site.Params.article.showCategories | default true) }}
|
||||||
{{ if (eq $taxonomy "categories") }}
|
{{ if (eq $taxonomy "categories") }}
|
||||||
<a class="relative mt-[0.5rem] me-2" href="{{ .RelPermalink }}">
|
<a class="relative mt-[0.5rem] me-2" href="{{ .RelPermalink }}">
|
||||||
{{ if .Params.showCategoriesInSecondaryColor | default (.Site.Params.article.showCategoriesInSecondaryColor | default false) }}
|
{{ $useSecondaryColor := .Params.showCategoriesInSecondaryColor | default (.Site.Params.article.showCategoriesInSecondaryColor | default false) }}
|
||||||
{{ partial "badge-secondary.html" .LinkTitle }}
|
{{ partial "badge.html" (dict "linkTitle" .LinkTitle "useSecondaryColor" $useSecondaryColor) }}
|
||||||
{{ else }}
|
|
||||||
{{ partial "badge.html" .LinkTitle }}
|
|
||||||
{{ end }}
|
|
||||||
</a>
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
<span class="flex cursor-pointer">
|
|
||||||
<span
|
|
||||||
class="rounded-md border border-secondary-400 px-1 py-[1px] text-xs font-normal text-secondary-700 dark:border-secondary-600 dark:text-secondary-400">
|
|
||||||
{{ . }}
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
@@ -1,6 +1,17 @@
|
|||||||
<span class="flex cursor-pointer">
|
<span class="flex cursor-pointer">
|
||||||
<span
|
{{ $linkTitle := . }}
|
||||||
class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400">
|
{{ $useSecondaryColor := false }}
|
||||||
{{ . }}
|
{{ if (reflect.IsMap . ) }}
|
||||||
|
{{ $linkTitle = .linkTitle }}
|
||||||
|
{{ $useSecondaryColor = cond (not .useSecondaryColor) false .useSecondaryColor }}
|
||||||
|
{{ end }}
|
||||||
|
{{ if $useSecondaryColor }}
|
||||||
|
<span
|
||||||
|
class="rounded-md border border-secondary-400 px-1 py-[1px] text-xs font-normal text-secondary-700 dark:border-secondary-600 dark:text-secondary-400">
|
||||||
|
{{ else }}
|
||||||
|
<span
|
||||||
|
class="rounded-md border border-primary-400 px-1 py-[1px] text-xs font-normal text-primary-700 dark:border-primary-600 dark:text-primary-400">
|
||||||
|
{{ end }}
|
||||||
|
{{ $linkTitle }}
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user