forked from CCCHH/ccchh-website
Show article for 30h after publishDate
This commit is contained in:
parent
1e8d6d0d7f
commit
e5278afd5d
3 changed files with 30 additions and 3 deletions
|
@ -164,6 +164,10 @@ body>main {
|
|||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin: 0.5rem 1rem;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0 1rem;
|
||||
}
|
||||
|
|
|
@ -27,6 +27,30 @@
|
|||
</div>
|
||||
{{- end }}
|
||||
|
||||
{{- $article := where (.Site.GetPage "blog").Pages ".Params.categories" "article" }}
|
||||
{{- $articleDisplayTime := time.ParseDuration "-30h" }}
|
||||
{{- $articleNew := where $article ".Params.publishDate" "ge" (time.Now.Add $articleDisplayTime) }}
|
||||
{{ if $articleNew }}
|
||||
<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 $articleNew.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 }}
|
||||
|
||||
|
||||
{{- $home := .Site.GetPage "/home" }}
|
||||
{{- $sections := where ($home.Resources.ByType "page") ".File.LogicalName" "index.md" }}
|
||||
{{- range sort $sections "File.Path" "asc" }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue