Refactor event handling in postCard and add event list layout
This commit is contained in:
30
layouts/event/list.html
Normal file
30
layouts/event/list.html
Normal 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 -}}
|
||||||
@@ -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 */}}
|
||||||
|
|||||||
Reference in New Issue
Block a user