Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/hossainemruz/toha.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Jasion <marcinjasion@gmail.com>2022-04-14 22:31:29 +0300
committerGitHub <noreply@github.com>2022-04-14 22:31:29 +0300
commita22474538d78e8f73339977de86f2b6408cf0c8e (patch)
treeb7c22f4621492a30dc232bd78f38beb82904ae4c
parent827a9409952e0e4192e9894708576bf41dc80dc6 (diff)
Add RSS post sorting by date descending (#580)
-rw-r--r--layouts/_default/rss.xml6
1 files changed, 3 insertions, 3 deletions
diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml
index 7c5a307..0e5e0d0 100644
--- a/layouts/_default/rss.xml
+++ b/layouts/_default/rss.xml
@@ -2,11 +2,11 @@
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}}
{{- if $.IsHome -}}
-{{- $pages = $pctx.RegularPages -}}
+{{- $pages = sort $pctx.RegularPages "Date" "desc" -}}
{{- else if $.IsSection -}}
-{{- $pages = $pctx.RegularPagesRecursive -}}
+{{- $pages = sort $pctx.RegularPagesRecursive "Date" "desc" -}}
{{- else -}}
-{{- $pages = $pctx.RegularPagesRecursive -}}
+{{- $pages = sort $pctx.RegularPagesRecursive "Date" "desc" -}}
{{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}