Theme: Combine events and articles into the same list
This commit is contained in:
parent
1952497883
commit
a8e87d5d29
1 changed files with 4 additions and 17 deletions
|
|
@ -12,25 +12,12 @@
|
||||||
{{- $articleDisplayTime := time.ParseDuration "-126h" }}
|
{{- $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 or $upcoming $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 $upcoming.ByDate }}
|
{{- range $neuigkeiten.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 }}
|
|
||||||
|
|
||||||
{{- range $articleNew.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" . ) }}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue