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

66 lines
2.4 KiB
HTML
Raw Permalink 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">
2023-10-22 00:17:53 +02:00
<h2 id="neuigkeiten" class="on-hover-trg">Neuigkeiten <a href="#neuigkeiten" class="on-hover"><i class="fa-solid fa-link small"></i></a></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">
2023-10-22 00:17:53 +02:00
{{- $hdg_id := .Title | lower | safeURL }}
<h2 id="{{ $hdg_id }}" class="on-hover-trg">{{ .Title }} <a href="#{{ $hdg_id }}" class="on-hover"><i class="fa-solid fa-link small"></i></a></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 }}
2023-11-03 19:40:42 +01:00
{{- $link := .Params.link }}
2023-10-17 22:52:36 +02:00
<div class="wide">
2023-11-03 19:40:42 +01:00
<h4><a href="{{ $link }}">{{ .Title }}</a></h4>
2023-10-17 22:52:36 +02:00
{{- $img_path := printf "%s%s" $subsec_dir .Params.Image }}
{{- with $home.Resources.Get $img_path }}
2023-11-04 22:26:11 +01:00
<a href="{{ $link }}"><img class="groups-img" src="{{ .RelPermalink }}"></a>
2023-10-17 22:52:36 +02:00
{{- 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-11-04 22:26:11 +01:00
<div class="img-link"><a href="{{ .params.url }}"><img src="{{ $img.RelPermalink }}" class="box-image" alt=""></a></div>
2023-10-02 12:08:18 +02:00
{{- end }}
</div>
{{- end }}
</div>
{{ end }}
</main>
{{ end }}