fix: exclude pages with "xml" = false or "externalUrl" that starts with http/https

This commit is contained in:
Gottfried Mayer 2024-10-10 13:19:14 +02:00 committed by GitHub
parent c2db79ee4b
commit c373f45313
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,7 +27,7 @@
{{- with .OutputFormats.Get "RSS" -}} {{- with .OutputFormats.Get "RSS" -}}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end -}} {{- 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> <item>
<title>{{ .Title }}</title> <title>{{ .Title }}</title>
<link>{{ .Permalink }}</link> <link>{{ .Permalink }}</link>
@ -44,6 +44,6 @@
{{- end -}} {{- end -}}
{{ end }} {{ end }}
</item> </item>
{{ end }} {{ end }}{{ end }}
</channel> </channel>
</rss> </rss>