fix date sorting
This commit is contained in:
parent
1287ea1d51
commit
942ef76fc9
@ -224,8 +224,8 @@
|
||||
{{ with .Site.GetPage "/termine/_index.md" }}
|
||||
|
||||
{{ $events := slice }}
|
||||
{{ range .Params.events }}
|
||||
{{ if or (ge (.date | time.AsTime).Unix now.Unix) (and .enddate (ge (.enddate | time.AsTime).Unix now.Unix)) }}
|
||||
{{ range sort .Params.events ".date" }}
|
||||
{{ if partial "data/termin-upcoming" . }}
|
||||
{{ $events = $events | append . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
1
layouts/partials/data/termin-upcoming.html
Normal file
1
layouts/partials/data/termin-upcoming.html
Normal file
@ -0,0 +1 @@
|
||||
{{ return or (ge (.date | time.AsTime) now) (and .enddate (ge (.enddate | time.AsTime) now)) }}
|
@ -86,7 +86,7 @@
|
||||
|
||||
{{ $top_banner := .Site.Data.homepage.top_banner }}
|
||||
{{ if and $top_banner.enable }}
|
||||
{{ if or (not $top_banner.temporarily.enable) (and $top_banner.temporarily.enable (and (le ($top_banner.temporarily.start_date | time.AsTime).Unix now.Unix ) (ge ($top_banner.temporarily.end_date | time.AsTime).Unix now.Unix))) }}
|
||||
{{ if or (not $top_banner.temporarily.enable) (and $top_banner.temporarily.enable (and (le ($top_banner.temporarily.start_date | time.AsTime) now) (ge ($top_banner.temporarily.end_date | time.AsTime) now))) }}
|
||||
{{ with $top_banner }}
|
||||
<div id="top-banner" class="p-3" style="background: {{ .color }}" data-pagefind-ignore>
|
||||
<div class="container">
|
||||
|
@ -1,2 +1 @@
|
||||
{{ $related := (where .Site.RegularPages "Type" .Type) | intersect (where .Site.Pages ".Title" "!=" .Title) | union (.Site.RegularPages.Related . ) | shuffle | first 3 }}
|
||||
{{ return $related }}
|
||||
{{ return (where .Site.RegularPages "Type" .Type) | intersect (where .Site.Pages ".Title" "!=" .Title) | union (.Site.RegularPages.Related . ) | shuffle | first 3 }}
|
@ -8,8 +8,8 @@
|
||||
<li class="list-inline-item m-3 text-uppercase" data-filter="past">Vergangen</li>
|
||||
</ul>
|
||||
<div class="filter-container row mx-auto">
|
||||
{{ range .Params.events }}
|
||||
<div class="filter-item col-12" data-groups="{{ if or (ge (.date | time.AsTime).Unix now.Unix) (and .enddate (ge (.enddate | time.AsTime).Unix now.Unix)) }}upcoming{{else}}past{{end}}" data-time="{{.date}}">
|
||||
{{ range sort .Params.events ".date" }}
|
||||
<div class="filter-item col-12" data-groups='{{if partial "data/termin-upcoming" .}}upcoming{{else}}past{{end}}'>
|
||||
{{ partial "termin" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user