2022-06-17 17:45:53 +02:00
|
|
|
{{ $title := .title }}
|
2022-06-24 20:39:21 +02:00
|
|
|
{{ $tt := .context.Title }}
|
2022-06-17 17:45:53 +02:00
|
|
|
{{ $link := .link }}
|
|
|
|
{{ $pages := .pages }}
|
|
|
|
{{ if and (.limit) (not .paginate) }}
|
|
|
|
{{ $pages = first .limit .pages }}
|
|
|
|
{{ end }}
|
|
|
|
{{ $act_section := .context.Section }}
|
|
|
|
{{ $paginator := .pages }}
|
2022-06-17 18:06:54 +02:00
|
|
|
{{ $return_paginator := "" }}
|
2022-06-17 17:45:53 +02:00
|
|
|
{{ if .paginate }}
|
|
|
|
{{ $paginator = .context.Paginate $pages }}
|
|
|
|
{{ $pages = $paginator.Pages }}
|
2022-06-17 18:06:54 +02:00
|
|
|
{{ $return_paginator := $paginator }}
|
2022-06-17 17:45:53 +02:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ $bptiny := "40em" }}
|
|
|
|
{{ $bpsmall := "48em" }}
|
|
|
|
{{ $bpmedium := "64em" }}
|
|
|
|
{{ $bplarge := "85.375em" }}
|
|
|
|
{{ $bpxlarge := "120em" }}
|
|
|
|
{{ $bpxxlarge := "160em" }}
|
|
|
|
|
|
|
|
{{ if $pages }}
|
2022-06-22 16:49:35 +02:00
|
|
|
<div class="gen_list">
|
2022-06-17 17:45:53 +02:00
|
|
|
{{ if $title }}
|
|
|
|
<h2 style="display: flex; align-items: baseline;">
|
|
|
|
{{ if $link }}
|
|
|
|
<a href="{{ $link | relLangURL }}">
|
|
|
|
{{ end }}
|
|
|
|
{{ $title }}
|
|
|
|
{{ if $link }}
|
|
|
|
</a>
|
|
|
|
<a href="{{ $link | relLangURL }}" style="text-decoration: underline; font-size: x-small; margin-left: 1em;">({{ if i18n "all" }}{{ i18n "all"}}{{ else }}{{ "all" }}{{ end }})</a>
|
|
|
|
{{ end }}
|
|
|
|
</h2>
|
|
|
|
{{ end }}
|
|
|
|
|
2022-06-23 22:17:04 +02:00
|
|
|
{{ range $pages.ByLastmod.Reverse }}
|
2022-06-17 17:45:53 +02:00
|
|
|
{{ $slug := "" }}
|
|
|
|
{{ with .File }}
|
|
|
|
{{ $slug = anchorize .ContentBaseName }}
|
|
|
|
{{ end }}
|
2022-06-24 19:28:46 +02:00
|
|
|
<div class="item">
|
2022-06-17 17:45:53 +02:00
|
|
|
{{ $metas := dict "when" .Params.when "price" .Params.price }}
|
|
|
|
{{ $banner := slice }}
|
|
|
|
{{ $image := slice }}
|
|
|
|
{{ $images := slice }}
|
|
|
|
{{ $dir := ""}}
|
|
|
|
{{ with .File }}
|
|
|
|
{{ $dir = .Dir }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if .Resources.GetMatch "banner*" }}
|
|
|
|
{{ $banner = slice (.Resources.GetMatch "banner*") }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if .Resources.ByType "image" }}
|
|
|
|
{{ $image = .Resources.ByType "image" }}
|
|
|
|
{{ end }}
|
|
|
|
{{ $images = complement $banner $image }}
|
|
|
|
{{ $image = (index (complement $banner $image) 0) }}
|
|
|
|
{{ $banner = (index $banner 0) }}
|
|
|
|
<a href="{{ .Permalink }}" class="list_item">
|
|
|
|
{{ if $title }}<h3>{{ else }}<h2>{{ end }}
|
|
|
|
{{ if ne $act_section "about" }}
|
|
|
|
{{ if .Params.events }}
|
2022-06-24 20:39:21 +02:00
|
|
|
{{ if not (in .Params.events $tt) }}
|
|
|
|
{{ index .Params.events 0 }}:
|
|
|
|
{{ end }}
|
2022-06-17 17:45:53 +02:00
|
|
|
{{ else if .Params.recurrent }}
|
|
|
|
{{ if i18n "recurrent"}}
|
|
|
|
{{ i18n "recurrent"}}:
|
|
|
|
{{ else }}
|
|
|
|
{{ "Recurrent"}}:
|
|
|
|
{{ end }}
|
2022-06-24 20:39:21 +02:00
|
|
|
{{ else if .Params.news }}
|
|
|
|
{{ if in .Params.news .Site.Params.ownCategory }}
|
2022-06-17 18:06:54 +02:00
|
|
|
{{ if i18n "own_category" }}{{ i18n "own_category" }}{{ else }}From us{{ end -}}:
|
2022-06-17 17:45:53 +02:00
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ .Title }}
|
|
|
|
{{ if $title }}</h3>{{ else }}</h2>{{ end }}
|
|
|
|
{{ with .Resources.GetMatch $banner }}
|
|
|
|
{{ $img := . }}
|
|
|
|
{{ $good_w := "1920"}}
|
|
|
|
{{ $good_h := "550"}}
|
|
|
|
{{ $b := true }}
|
|
|
|
{{ if or (lt (int .Width) $good_w) (gt (int .Width) $good_w) (lt (int .Height) $good_h) (gt (int .Height) $good_h) }}
|
|
|
|
<div class="dev left">
|
|
|
|
{{ if lt (int .Width) $good_w }}
|
|
|
|
{{ $b = false }}
|
|
|
|
{{ if eq hugo.Environment "development" }}
|
|
|
|
Width: {{ .Width }}px: too small, must be {{ $good_w -}}px in width<br>
|
|
|
|
{{ end }}
|
|
|
|
{{ else if gt (int .Width) $good_w }}
|
|
|
|
{{ $b = false }}
|
|
|
|
{{ if eq hugo.Environment "development" }}
|
|
|
|
Width: {{ .Width }}px: too big, must be {{ $good_w -}}px in width<br>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if lt (int .Height) $good_h }}
|
|
|
|
{{ $b = false }}
|
|
|
|
{{ if eq hugo.Environment "development" }}
|
|
|
|
Height: {{ .Height }}px: too small, must be {{ $good_h -}}px in height<br>
|
|
|
|
{{ end }}
|
|
|
|
{{ else if gt (int .Height) $good_h }}
|
|
|
|
{{ $b = false }}
|
|
|
|
{{ if eq hugo.Environment "development" }}
|
|
|
|
Height: {{ .Height }}px: too big, must be {{ $good_h -}}px in height<br>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if eq hugo.Environment "development" }}
|
|
|
|
{{ if eq $b false }}
|
|
|
|
{{ printf "Please correct content/news/%s/%s" $slug .Name }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{{ end }}
|
|
|
|
{{ if eq $b true }}
|
2022-06-24 19:33:57 +02:00
|
|
|
{{ $tiny := ($banner.Resize "640x q50") }}
|
|
|
|
{{ $small := ($banner.Resize "768x q50") }}
|
|
|
|
{{ $medium := ($banner.Resize "1024x q50") }}
|
|
|
|
{{ $large := ($banner.Resize "1366x q50") }}
|
2022-06-17 17:45:53 +02:00
|
|
|
<img loading="lazy" srcset="{{- with $tiny.RelPermalink -}}{{.}} 640w{{- end -}}
|
|
|
|
{{- with $small.RelPermalink -}}, {{.}} 768w{{- end -}}
|
|
|
|
{{- with $medium.RelPermalink -}}, {{.}} 1024w{{- end -}}
|
|
|
|
{{- with $large.RelPermalink -}}, {{.}} 1366w{{- end -}}"
|
|
|
|
src="{{ $banner.RelPermalink }}" alt="Banner Image." />
|
|
|
|
{{ end }}
|
|
|
|
{{ else }}
|
2022-07-08 16:04:19 +02:00
|
|
|
{{- if eq hugo.Environment "development" }}
|
2022-06-17 17:45:53 +02:00
|
|
|
<div class="dev left">
|
|
|
|
{{ printf "content/%sbanner* missing.." $dir }}
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ partial "snippets/article_metadata" $metas }}
|
|
|
|
<div class="text">
|
|
|
|
{{ if .Description }}
|
|
|
|
<p>{{ .Description }}</p>
|
|
|
|
{{ else if .Content }}
|
2022-07-08 16:09:07 +02:00
|
|
|
{{- $summary := "" -}}
|
2022-06-17 17:45:53 +02:00
|
|
|
{{ if in .RawContent "<!--more-->" }}
|
|
|
|
{{ $tmp := split .RawContent "<!--more-->" }}
|
2022-06-24 20:46:34 +02:00
|
|
|
<p>
|
2022-06-17 17:45:53 +02:00
|
|
|
{{ index $tmp 0 | markdownify }}
|
2022-06-24 20:46:34 +02:00
|
|
|
</p>
|
2022-06-17 17:45:53 +02:00
|
|
|
{{ else }}
|
|
|
|
{{ if hasPrefix .Summary "<p>" }}
|
|
|
|
{{ .Summary }}
|
|
|
|
{{ else }}
|
|
|
|
<p>{{ .Summary }} </p>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ else if $image }}
|
|
|
|
{{ $i := (.Resources.GetMatch $image) }}
|
|
|
|
{{ $tiny := ($i.Resize "640x q90") }}
|
|
|
|
{{ $small := ($i.Resize "768x q90") }}
|
2022-07-08 16:02:35 +02:00
|
|
|
{{ $medium := ($i.Resize "1024x q90") }}
|
2022-06-17 17:45:53 +02:00
|
|
|
{{ $large := ($i.Resize "1366x q90") }}
|
|
|
|
<img loading="lazy" srcset="{{- with $tiny.RelPermalink -}}{{.}} 640w{{- end -}}
|
|
|
|
{{- with $small.RelPermalink -}}, {{.}} 768w{{- end -}}
|
|
|
|
{{- with $medium.RelPermalink -}}, {{.}} 1024w{{- end -}}
|
|
|
|
{{- with $large.RelPermalink -}}, {{.}} 1366w{{- end -}}"
|
|
|
|
src="{{ $i.RelPermalink }}" alt="Banner Image." />
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
{{ if .Truncated }}
|
|
|
|
<div class="readmore">
|
|
|
|
{{ if i18n "readmore" }}{{ i18n "readmore" }}{{ else }}{{ "read more" }}{{ end }}..
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
</a>
|
2022-06-22 18:27:39 +02:00
|
|
|
</div>
|
2022-06-17 17:45:53 +02:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ if .paginate }}
|
|
|
|
{{ partial "snippets/paginator" (dict "paginator" $paginator) }}
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
{{ end }}
|