diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 18d60f54..a6df0714 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -25,125 +25,139 @@ {{ $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") }} - + {{ $jsPage := resources.Get "js/page.js" }} + {{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint ($.Site.Params.fingerprintAlgorithm | default "sha512") }} + {{ end }} -
- {{ if $toc }} +
+ {{ if $toc }}
-
+
{{ partial "toc.html" . }}
- {{ end }} -
- {{ .Content }} -
-
+ {{ end }} +
+ {{ .Content }} +
+
- {{ 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 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 }} + {{ if not $cardView }} +
+ {{ if not $orderByWeight }} + {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }} + {{ if $groupByYear }} +

+ {{ .Key }} +

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

- {{ .Key }} -

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

- {{ .Key }} -

-
+ {{ 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 }} + {{ 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 }} - - {{ 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 }} - +
+ {{ end }} {{ end }} - {{ else }} -
-

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

-
+ {{ end }} + {{ else }} +
+

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

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