ccchh-website/themes/ccchh/layouts/index.html

45 lines
1.3 KiB
HTML
Raw Normal View History

2023-10-02 12:08:18 +02:00
{{ define "main" }}
<main class="container" aria-role="main">
<div class="homepage-content">
{{ .Content }}
</div>
{{- $events := where (.Site.GetPage "blog").Pages ".Params.categories" "event" }}
2023-10-02 12:08:18 +02:00
{{- $upcoming := where $events ".Params.date" "ge" now }}
2023-10-08 17:38:54 +02:00
{{ if $upcoming }}
2023-10-02 12:08:18 +02:00
<div class="announcements">
<h3>Neuigkeiten</h3>
{{- range $upcoming.ByDate }}
<div class="announcement">
2023-10-08 17:38:54 +02:00
{{- partial "blog-header.html" (dict "headingLink" true "level" 4 "reduced" true "page" . ) }}
{{- if in .RawContent "<!--more-->" }}
{{ .Summary | safeHTML }}
{{- else }}
<p>{{ .Summary | safeHTML }}</p>
2023-10-02 12:08:18 +02:00
{{- end }}
</div>
{{- end }}
</div>
{{- end }}
{{- $home_sections := .Site.GetPage "/home" }}
{{- range sort ($home_sections.Resources.Match "*.md") ".Name" }}
<div class="section">
<h3>{{ .Title }}</h3>
{{ .Content -}}
{{- with .Params.Resources }}
<div class="flex-grid">
{{- range . }}
{{- $img := $home_sections.Resources.GetMatch (printf "%s" .src) }}
<div class="img-link"><a href="{{ .params.url }}"><img src="{{ $img.Permalink }}" class="box-image" alt=""></a></div>
{{- end }}
</div>
{{- end }}
</div>
{{ end }}
</main>
{{ end }}