mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-29 03:53:30 +08:00
Prevent duplicate tags and categories information
This commit is contained in:
parent
d774192b8d
commit
53cc81d76a
@ -1,8 +1,17 @@
|
|||||||
{{- $scope := default "homepage" .Scope -}}
|
{{- $scope := default "homepage" .Scope -}}
|
||||||
{{- $context := .Context -}}
|
{{- $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) -}}
|
{{- with (index .Context.Site.Params.widgets $scope) -}}
|
||||||
<aside class="sidebar right-sidebar sticky">
|
<aside class="sidebar right-sidebar sticky">
|
||||||
{{ range $widget := . }}
|
{{ 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) }}
|
{{ if templates.Exists (printf "partials/widget/%s.html" .type) }}
|
||||||
{{ partial (printf "widget/%s" .type) (dict "Context" $context "Params" .params) }}
|
{{ partial (printf "widget/%s" .type) (dict "Context" $context "Params" .params) }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
|
Loading…
Reference in New Issue
Block a user