### Topics

{{ $cats := slice }} {{ range $name, $taxonomy := site.Taxonomies.categories }} {{ $cats = $cats | append (dict "name" $name "count" (len $taxonomy.Pages) "page" $taxonomy.Page ) }} {{ end }} {{ $cats = sort $cats "count" "desc" }}
{{ range $index, $cat := first 5 $cats }} {{ $catName := index $cat "name" }}
{{/* 取出這個 category 底下的文章 */}} {{ $t := slice $catName }} {{ range $i, $post := where site.RegularPages ".Params.categories" "intersect" $t }} {{/* 第 0、1 則：大圖卡片 */}} {{ if or (eq $i 0) (eq $i 1) }}
{{ range ($post.GetTerms "categories") }} {{ .LinkTitle }} {{ end }} {{ $post.Date | time.Format ":date_long" }}

## {{ $post.Params.title }}

{{/* 第 2～5 則：右側小圖列表 */}} {{ else if or (eq $i 2) (eq $i 3) (eq $i 4) (eq $i 5) }}
{{ range ($post.GetTerms "categories") }} {{ .LinkTitle }} {{ end }} {{ $post.Date | time.Format ":date_long" }}

## {{ $post.Params.title }}

{{ end }} {{ end }} {{/* range posts in this category */}}
{{ end }} {{/* range $cats for tab panes */}}