25 lines
1.2 KiB
HTML
25 lines
1.2 KiB
HTML
{{ define "title" }}
|
|
<h1>{{ .Title }}</h1>
|
|
{{ end }}
|
|
|
|
{{ define "content" }}
|
|
{{- $all := where (where .Site.RegularPages "Permalink" "!=" .Permalink) "Type" "in" .Site.Params.searchSections }}
|
|
{{ $days := int (mul (mul (int .Site.Params.featured_expire) 7) -1) }}
|
|
{{ $featured := where (where (where $all ".Params.featured" "=" true) "Type" "in" .Site.Params.searchSections) ".Params.Lastmod" "gt" (now.AddDate 0 0 $days) }}
|
|
{{ $featured = $all | intersect $featured }}
|
|
{{ $posts := $all | complement $featured }}
|
|
{{- $paginator := .Paginate $posts -}}
|
|
{{ if eq $paginator.PageNumber 1 }}
|
|
{{ if ne .Content "" }}
|
|
{{ partial "snippets/content" (dict "content" .Content) }}
|
|
{{ end }}
|
|
{{ partial "l1/article_list" (dict "context" . "pages" $featured "amount" "3" "title" "Featured") }}
|
|
{{ end }}
|
|
{{ if gt (len $posts) 1 }}
|
|
{{ partial "l1/article_list" (dict "context" . "paginator" $paginator "amount" "5" "title" "News" "type" "list") }}
|
|
<div id="pagination_outer" style="display: flex; justify-content: center;">
|
|
{{ partial "snippets/paginator" (dict "paginator" $paginator) }}
|
|
</div>
|
|
{{ end }}
|
|
{{ end }}
|