Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
a8e87d5d29 Theme: Combine events and articles into the same list 2026-06-10 20:28:18 +02:00
1952497883 Theme: Fix doubled "Neuigkeiten" heading
All checks were successful
/ build (pull_request) Successful in 42s
2026-06-08 22:27:24 +02:00
22ac93080c Theme: Display articles for 5 days (+6 hours) 2026-06-08 22:27:24 +02:00
3 changed files with 11 additions and 25 deletions

View file

@ -2,9 +2,7 @@
categories: article categories: article
title: 'DIDAY.org mit Unterstützung des CCCHH' title: 'DIDAY.org mit Unterstützung des CCCHH'
date: '2026-06-07T14:00:00+02:00' # date of the event date: '2026-06-07T14:00:00+02:00' # date of the event
publishDate: '2026-06-07T14:00:00+02:00' # when to publish
draft: false draft: false
location: Z9
authors: authors:
- stb - stb
tags: tags:

View file

@ -7,33 +7,17 @@
{{- $events := where (.Site.GetPage "blog").Pages ".Params.categories" "event" }} {{- $events := where (.Site.GetPage "blog").Pages ".Params.categories" "event" }}
{{- $lookback := time.ParseDuration "-6h" }} {{- $lookback := time.ParseDuration "-6h" }}
{{- $upcoming := where $events ".Params.date" "ge" (time.Now.Add $lookback) }} {{- $upcoming := where $events ".Params.date" "ge" (time.Now.Add $lookback) }}
{{ if $upcoming }}
<div class="announcements">
<h2 id="neuigkeiten" class="on-hover-trg">Neuigkeiten <a href="#neuigkeiten" class="on-hover"><i class="fa-solid fa-link small"></i></a></h2>
{{- range $upcoming.ByDate }}
<div class="announcement">
{{- partial "blog-header.html" (dict "headingLink" true "level" 4 "reduced" true "page" . ) }}
{{- if in .RawContent "<!--more-->" }}
{{ .Summary | safeHTML }}
{{- else }}
<p>{{ .Summary | safeHTML }}</p>
{{- end }}
{{- if .Truncated }}
<p class="ellipsis"><a href="{{ .RelPermalink }}">mehr lesen</a></p>
{{- end }}
</div>
{{- end }}
</div>
{{- end }}
{{- $article := where (.Site.GetPage "blog").Pages ".Params.categories" "article" }} {{- $article := where (.Site.GetPage "blog").Pages ".Params.categories" "article" }}
{{- $articleDisplayTime := time.ParseDuration "-30h" }} {{- $articleDisplayTime := time.ParseDuration "-126h" }}
{{- $articleNew := where $article ".Params.publishDate" "ge" (time.Now.Add $articleDisplayTime) }} {{- $articleNew := where $article ".Params.publishDate" "ge" (time.Now.Add $articleDisplayTime) }}
{{ if $articleNew }}
{{- $neuigkeiten := $upcoming | append $articleNew }}
{{ if $neuigkeiten }}
<div class="announcements"> <div class="announcements">
<h2 id="neuigkeiten" class="on-hover-trg">Neuigkeiten <a href="#neuigkeiten" class="on-hover"><i class="fa-solid fa-link small"></i></a></h2> <h2 id="neuigkeiten" class="on-hover-trg">Neuigkeiten <a href="#neuigkeiten" class="on-hover"><i class="fa-solid fa-link small"></i></a></h2>
{{- range $articleNew.ByDate }} {{- range $neuigkeiten.ByDate }}
<div class="announcement"> <div class="announcement">
{{- partial "blog-header.html" (dict "headingLink" true "level" 4 "reduced" true "page" . ) }} {{- partial "blog-header.html" (dict "headingLink" true "level" 4 "reduced" true "page" . ) }}

View file

@ -14,7 +14,11 @@
{{- end }} {{- end }}
<div class="infos"> <div class="infos">
{{ if (eq .Params.categories "event") }}
<span class="li-space"><i class="fa-solid fa-calendar-day"></i> {{ .Date | time.Format "Mon, 2006-01-02 15:04" }}</span> <span class="li-space"><i class="fa-solid fa-calendar-day"></i> {{ .Date | time.Format "Mon, 2006-01-02 15:04" }}</span>
{{- else }}
<span class="li-space"><i class="fa-solid fa-newspaper"></i> {{ .Date | time.Format "2006-01-02" }}</span>
{{- end }}
{{- with .Params.location }} {{- with .Params.location }}
<span class="li-space"> <span class="li-space">
<i class="fa-solid fa-location-dot"></i> <i class="fa-solid fa-location-dot"></i>