Add RSS post sorting by date descending (#580)

This commit is contained in:
Marcin Jasion 2022-04-14 21:31:29 +02:00 committed by GitHub
parent 827a940995
commit a22474538d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,11 +2,11 @@
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} {{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}} {{- $pages := slice -}}
{{- if $.IsHome -}} {{- if $.IsHome -}}
{{- $pages = $pctx.RegularPages -}} {{- $pages = sort $pctx.RegularPages "Date" "desc" -}}
{{- else if $.IsSection -}} {{- else if $.IsSection -}}
{{- $pages = $pctx.RegularPagesRecursive -}} {{- $pages = sort $pctx.RegularPagesRecursive "Date" "desc" -}}
{{- else -}} {{- else -}}
{{- $pages = $pctx.RegularPagesRecursive -}} {{- $pages = sort $pctx.RegularPagesRecursive "Date" "desc" -}}
{{- end -}} {{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}} {{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}} {{- if ge $limit 1 -}}