{{ define "main" }} {{ .Scratch.Set "scope" "list" }} {{ $enableToc := .Params.showTableOfContents | default (site.Params.list.showTableOfContents | default false) }} {{ $showToc := and $enableToc (in .TableOfContents " {{ if .Params.showBreadcrumbs | default (site.Params.list.showBreadcrumbs | default false) }} {{ partial "breadcrumbs.html" . }} {{ end }}

{{ .Title }}

{{ partial "article-meta/list.html" (dict "context" . "scope" "single") }}
{{ $translations := .AllTranslations }} {{ with .File }} {{ $path := .Path }} {{ range $translations }} {{ $lang := print "." .Lang ".md" }} {{ $path = replace $path $lang ".md" }} {{ end }} {{ $jsPage := resources.Get "js/page.js" }} {{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint (site.Params.fingerprintAlgorithm | default "sha512") }} {{ end }} {{/* Description (markdown content) */}} {{ $tocMargin := cond $showToc "mt-12" "mt-0" }} {{ $topClass := cond (hasPrefix site.Params.header.layout "fixed") "lg:top-[140px]" "lg:top-10" }}
{{ if $showToc }}
{{ partial "toc.html" . }}
{{ end }}
{{ .Content }}
{{/* Article Grid */}} {{ if gt .Pages 0 }} {{ $cardView := .Params.cardView | default (site.Params.list.cardView | default false) }} {{ $cardViewScreenWidth := .Params.cardViewScreenWidth | default (site.Params.list.cardViewScreenWidth | default false) }} {{ $groupByYear := .Params.groupByYear | default (site.Params.list.groupByYear | default false) }} {{ $orderByWeight := .Params.orderByWeight | default (site.Params.list.orderByWeight | default false) }} {{ $groupByYear := and (not $orderByWeight) $groupByYear }} {{ if not $cardView }}
{{ if not $orderByWeight }} {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} {{ if $groupByYear }}

{{ .Key }}

{{ end }} {{ range .Pages }} {{ partial "article-link/simple.html" . }} {{ end }} {{ end }} {{ else }} {{ range (.Paginate (.Pages.ByWeight)).Pages }} {{ partial "article-link/simple.html" . }} {{ end }} {{ end }}
{{/* else: is cardView */}} {{ else }} {{ if $groupByYear }} {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} {{ if $cardViewScreenWidth }}

{{ .Key }}

{{ range .Pages }} {{ partial "article-link/card.html" . }} {{ end }}
{{ else }}

{{ .Key }}

{{ range .Pages }} {{ partial "article-link/card.html" . }} {{ end }}
{{ end }} {{ end }} {{/* else: not groupByYear */}} {{ else }} {{ if $cardViewScreenWidth }}
{{ if not $orderByWeight }} {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} {{ range .Pages }} {{ partial "article-link/card.html" . }} {{ end }} {{ end }} {{ else }} {{ range (.Paginate (.Pages.ByWeight)).Pages }} {{ partial "article-link/card.html" . }} {{ end }} {{ end }}
{{ else }}
{{ if not $orderByWeight }} {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} {{ range .Pages }} {{ partial "article-link/card.html" . }} {{ end }} {{ end }} {{ else }} {{ range (.Paginate (.Pages.ByWeight)).Pages }} {{ partial "article-link/card.html" . }} {{ end }} {{ end }}
{{ end }}{{/* End of cardViewScreenWidth */}} {{ end }}{{/* End of groupByYear */}} {{ end }}{{/* End of cardView */}} {{/* else: .Pages not greater to zero */}} {{ else }}

{{ i18n "list.no_articles" | emojify }}

{{ end }} {{ partial "pagination.html" . }} {{ end }}