Refactor event handling in postCard and add event list layout

This commit is contained in:
Fundor333
2025-09-30 00:41:22 +02:00
parent 594c916940
commit afd12144e6
2 changed files with 36 additions and 1 deletions

30
layouts/event/list.html Normal file
View File

@@ -0,0 +1,30 @@
{{- define "main" -}}
{{ $year := 30000 }}
{{ $dataYear := "" }}
<div class="wrapper list-page">
<header class="header">
<h1 class="header-title center">{{ .Title }}</h1>
</header>
<main class="page-content" aria-label="Content">
{{ range (site.Pages.GroupByParam "start").Reverse}}
{{ $dataYear = (dateFormat "2006" .Key ) }}
{{ if lt $dataYear $year }}
{{ $year = $dataYear }}
<h2 class="year">{{ $year }}</h2>
{{ end }}
{{/* create a list of posts for each month, with month as heading */}}
{{ range .Pages }}
{{ partial "postCard" . }}
{{ end }} {{/* end range .Pages */}}
{{ end }} {{/* end range .Pages.GroupByDate "2006" */}}
</main>
</div>
{{- end -}}

View File

@@ -33,7 +33,12 @@
<i class="fa-whiteboard fa-semibold fa-microphone fa-xl"></i> <i class="fa-whiteboard fa-semibold fa-microphone fa-xl"></i>
</div> </div>
{{ end }} {{ end }}
{{if not (eq .Type "series") }} {{if eq .Type "event" }}
<time class="post-item-meta" datetime="{{ dateFormat $ISO_date .Params.start }}">
{{ time.Format $configDateFormat .Params.start }}
{{/* OLD FORMAT: .Date.Format $configDateFormat */}}
</time>
{{else if not (eq .Type "series") }}
<time class="post-item-meta" datetime="{{ dateFormat $ISO_date .Date }}"> <time class="post-item-meta" datetime="{{ dateFormat $ISO_date .Date }}">
{{ time.Format $configDateFormat .Date }} {{ time.Format $configDateFormat .Date }}
{{/* OLD FORMAT: .Date.Format $configDateFormat */}} {{/* OLD FORMAT: .Date.Format $configDateFormat */}}