Prevent duplicate tags and categories information

This commit is contained in:
Jacob Zhong 2023-01-15 13:57:30 -05:00
parent d774192b8d
commit 53cc81d76a

View File

@ -1,8 +1,17 @@
{{- $scope := default "homepage" .Scope -}}
{{- $context := .Context -}}
{{- $isCategoriesPage := and (eq $context.Kind "taxonomy") (eq $context.Type "categories") }}
{{- $isTagsPage := and (eq $context.Kind "taxonomy") (eq $context.Type "tags") }}
{{- with (index .Context.Site.Params.widgets $scope) -}}
<aside class="sidebar right-sidebar sticky">
{{ range $widget := . }}
{{ if and $isCategoriesPage (eq .type "categories") }}
{{ continue }}
{{ end }}
{{ if and $isTagsPage (eq .type "tag-cloud") }}
{{ continue }}
{{ end }}
{{ if templates.Exists (printf "partials/widget/%s.html" .type) }}
{{ partial (printf "widget/%s" .type) (dict "Context" $context "Params" .params) }}
{{ else }}