Skip to content

Commit

Permalink
fix: exclude pages with "xml" = false or "externalUrl" that starts wi…
Browse files Browse the repository at this point in the history
…th http/https
  • Loading branch information
fuse314 authored Oct 10, 2024
1 parent c2db79e commit c373f45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions layouts/_default/rss.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{{- with .OutputFormats.Get "RSS" -}}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end -}}
{{ range $pages }}
{{ range $pages }}{{ if and (.Param "xml" | default true) (or (not .Params.externalUrl) (and (.Params.externalUrl) (and (not (hasPrefix .Params.externalUrl "http://")) (not (hasPrefix .Params.externalUrl "https://"))))) }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
Expand All @@ -44,6 +44,6 @@
{{- end -}}
{{ end }}
</item>
{{ end }}
{{ end }}{{ end }}
</channel>
</rss>

0 comments on commit c373f45

Please sign in to comment.