fix(archive): display categories list when it's available

This commit is contained in:
Jimmy Cai 2020-09-07 12:32:08 +02:00
parent 3d57bfd59f
commit 37ca2cc167
No known key found for this signature in database
GPG Key ID: 3EA408E527F37B18

View File

@ -5,16 +5,19 @@
{{ partial "sidebar/left.html" . }}
<main class="main template-archive">
{{ $categories := ($.Site.GetPage "taxonomyTerm" "categories").Pages }}
{{ if $categories }}
<div class="widget">
<h1 class="widget-title">Categories</h1>
<div class="category-list">
<div class="article-list--tile">
{{ range ($.Site.GetPage "taxonomyTerm" "categories").Pages }}
{{ range $categories }}
{{ partial "article-list/tile" (dict "context" . "size" "250x150") }}
{{ end }}
</div>
</div>
</div>
{{ end }}
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}