Skip to content

Commit

Permalink
RSS: Serve blog posts only
Browse files Browse the repository at this point in the history
  • Loading branch information
cal0pteryx committed Mar 29, 2024
1 parent bdaacc4 commit b4a3735
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions themes/xmpp-providers/layouts/_default/rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,7 @@
{{- end }}
{{- end }}

{{- $pctx := . }}
{{- if .IsHome }}{{ $pctx = .Site }}{{ end }}
{{- $pages := slice }}
{{- if or $.IsHome $.IsSection }}
{{- $pages = $pctx.RegularPages }}
{{- else }}
{{- $pages = $pctx.Pages }}
{{- end }}
{{- $limit := .Site.Config.Services.RSS.Limit }}
{{- if ge $limit 1 }}
{{- $pages = $pages | first $limit }}
{{- end }}
{{- $pages := where (where .Site.Pages ".Section" "blog") "Kind" "page" -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
Expand All @@ -57,7 +46,7 @@
{{- with .OutputFormats.Get "RSS" }}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end }}
{{- range $pages }}
{{- range $pages -}}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
Expand Down

0 comments on commit b4a3735

Please sign in to comment.