47 lines
1.4 KiB
HTML
47 lines
1.4 KiB
HTML
{{ define "banner" }}
|
|
{{ $image := "" }}
|
|
{{ if .Resources.GetMatch "banner*" }}
|
|
{{ $image = .Resources.GetMatch "banner*" }}
|
|
{{ end }}
|
|
{{ partial "snippets/banner_new" (dict "context" . "image" $image "section" .Section) }}
|
|
{{ end }}
|
|
|
|
{{ define "intro" }}
|
|
|
|
{{ if ne .Content "" }}
|
|
{{ partial "snippets/content" (dict "content" .Content) }}
|
|
{{ end }}
|
|
|
|
{{ 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) }}
|
|
|
|
{{ if eq hugo.Environment "development" }}
|
|
{{ "" }}
|
|
{{ end }}
|
|
|
|
{{ $featured = $all | intersect $featured }}
|
|
{{ $posts := $all | complement $featured }}
|
|
{{ $news := "news" }}
|
|
{{ if i18n $news }}
|
|
{{ $news = i18n $news }}
|
|
{{ end }}
|
|
{{ $feat := "featured" }}
|
|
{{ if i18n $feat }}
|
|
{{ $feat = i18n $feat }}
|
|
{{ end }}
|
|
<div class="two_lists">
|
|
{{ partial "snippets/gen_list" (dict "context" . "pages" $featured "title" $feat "limit" "5" )}}
|
|
{{ partial "snippets/gen_list" (dict "context" . "pages" $posts "title" $news "link" "news" "limit" "5" )}}
|
|
</div>
|
|
{{ end }}
|
|
|
|
|
|
{{ define "sidebar" }}
|
|
{{ "" }}
|
|
{{ end }}
|