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

64 lines
2 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">
<h2>Neuigkeiten</h2>
2023-10-02 12:08:18 +02:00
{{- 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 }}
2023-10-17 22:07:39 +02:00
{{- $home := .Site.GetPage "/home" }}
2023-10-17 22:52:36 +02:00
{{- $sections := where ($home.Resources.ByType "page") ".File.LogicalName" "index.md" }}
{{- range sort $sections "File.Path" "asc" }}
2023-10-02 12:08:18 +02:00
<div class="section">
<h2>{{ .Title }}</h2>
2023-10-02 12:08:18 +02:00
{{ .Content -}}
2023-10-17 22:52:36 +02:00
{{- $subsec_dir := strings.TrimLeft "home/" .File.Dir }}
{{- $subsec_glob := printf "%s*.md" (strings.TrimLeft "home/" .File.Dir) }}
{{- $subsecs := where ($home.Resources.Match $subsec_glob) ".File.LogicalName" "!=" "index.md" }}
{{- if $subsecs }}
<div class="flex-grid">
{{- range $subsecs }}
<div class="wide">
<h4>{{ .Title }}</h4>
{{- $img_path := printf "%s%s" $subsec_dir .Params.Image }}
{{- with $home.Resources.Get $img_path }}
<img class="groups-img" src="{{ .Permalink }}">
{{- end }}
{{ .Content }}
</div>
{{- end }}
</div>
{{- end }}
2023-10-02 12:08:18 +02:00
{{- with .Params.Resources }}
<div class="flex-grid">
{{- range . }}
2023-10-17 22:52:36 +02:00
{{- $img := $home.Resources.GetMatch (printf "*/%s" .src) }}
2023-10-02 12:08:18 +02:00
<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 }}