sidebar: fix date display, include non-regular pages in 'related pages' list

This commit is contained in:
Helmut Merz 2024-01-28 08:31:37 +01:00
parent baa84ea713
commit 039399f93c
2 changed files with 6 additions and 4 deletions

View file

@ -18,7 +18,9 @@
{{- end -}}
<a href="{{ $url }}" title="{{ $btitle }}">{{ $page.Title }}{{ $btext }}&nbsp;&nbsp;
{{ if $page.Date -}}
<small>{{ $page.Date.Format (i18n "dateFormat") }}</small>
{{- if not .Params.nodate -}}
<small>{{ $page.Date.Format (i18n "dateFormat") }}</small>
{{- end -}}
{{- else if $page.Params.Teaser -}}<small>{{ $page.Params.Teaser }}</small>
{{- else -}}<small>{{ $page.Summary }}</small>
{{- end }}

View file

@ -64,14 +64,14 @@
{{- end }}
{{- if not .Site.Params.hideParentArticles -}}
{{- $related := where .Site.RegularPages "Params.pageid" "in" .Params.parents -}}
{{- $related := where .Site.Pages "Params.pageid" "in" .Params.parents -}}
{{- partial "card-related"
(dict "related" $related "header" (i18n "parent-articles") "id" "parents") -}}
{{- end -}}
{{- if and (not .Site.Params.hideChildArticles)
(ne .Site.Params.showChildArticles "cards") -}}
{{- $related := .Site.RegularPages.RelatedTo (keyVals "parents" .Params.pageid) -}}
{{- $related := .Site.Pages.RelatedTo (keyVals "parents" .Params.pageid) -}}
{{- partial "card-related"
(dict "related" $related "header" (i18n "child-articles") "id" "children") -}}
{{- end -}}
@ -83,7 +83,7 @@
{{- end -}}
{{- if not .Site.Params.hideSiblingArticles -}}
{{- $related := .Site.RegularPages.RelatedIndices . "parents" -}}
{{- $related := .Site.Pages.RelatedIndices . "parents" -}}
{{- partial "card-related"
(dict "related" $related "header" (i18n "sibling-articles") "id" "siblings") -}}
{{- end -}}