Skip to content

Commit

Permalink
Add RSS post sorting by date descending (#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjasion authored Apr 14, 2022
1 parent 827a940 commit a224745
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions layouts/_default/rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down

0 comments on commit a224745

Please sign in to comment.