Experiment with setting Netlify URL in the RSS (#10902)

* Experiment with setting Netlify URL in the RSS

* Fixes to make the feed validate
This commit is contained in:
craigbox 2022-02-14 15:28:02 +00:00 committed by GitHub
parent 1a3a3cd05a
commit 1867c3e56a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 27 deletions

View File

@ -1,4 +1,4 @@
{{ $home := .Site.BaseURL }} {{ $home := .Site.BaseURL | printf "%s%s" (os.Getenv "DEPLOY_PRIME_URL") }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel> <channel>
@ -9,6 +9,7 @@
{{ end }} {{ end }}
<link>{{ $home }}</link> <link>{{ $home }}</link>
<image> <image>
<title>Istio Blog</title>
<url>{{ $home }}/favicons/android-192x192.png</url> <url>{{ $home }}/favicons/android-192x192.png</url>
<link>{{ $home }}</link> <link>{{ $home }}</link>
</image> </image>
@ -20,14 +21,12 @@
{{ if and (not $post.Draft) $post.IsPage }} {{ if and (not $post.Draft) $post.IsPage }}
<item> <item>
<title>{{ $post.Title }}</title> <title>{{ $post.Title }}</title>
<description>{{ $post.Content | html }}</description> <description>{{ `<![CDATA[` | safeHTML }}{{ $post.Content | safeHTML }}{{ `]]>` | safeHTML }}</description>
<pubDate>{{ $post.PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> <pubDate>{{ $post.PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<link>{{ $post.Permalink }}</link> <link>{{ $home }}{{ $post.RelPermalink }}</link>
<author>{{ $post.Params.attribution }}</author> <guid isPermaLink="true">{{ $home }}{{ $post.RelPermalink }}</guid>
<guid isPermaLink="true">{{ $post.Permalink }}</guid>
{{ range $kw := $post.Keywords }} {{ range $kw := $post.Keywords }}
<category>{{ $kw }}</category> <category>{{ $kw }}</category>
{{ end }} {{ end }}
</item> </item>
{{ end }} {{ end }}

View File

@ -1,4 +1,4 @@
{{ $home := .Site.BaseURL }} {{ $home := .Site.BaseURL | printf "%s%s" (os.Getenv "DEPLOY_PRIME_URL") }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel> <channel>
@ -9,6 +9,7 @@
{{ end }} {{ end }}
<link>{{ $home }}</link> <link>{{ $home }}</link>
<image> <image>
<title>Istio News</title>
<url>{{ $home }}/favicons/android-192x192.png</url> <url>{{ $home }}/favicons/android-192x192.png</url>
<link>{{ $home }}</link> <link>{{ $home }}</link>
</image> </image>
@ -21,14 +22,12 @@
{{ if not $post.Draft }} {{ if not $post.Draft }}
<item> <item>
<title>{{ $post.Title }}</title> <title>{{ $post.Title }}</title>
<description>{{ $post.Content | html }}</description> <description>{{ `<![CDATA[` | safeHTML }}{{ $post.Content | safeHTML }}{{ `]]>` | safeHTML }}</description>
<pubDate>{{ $post.PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> <pubDate>{{ $post.PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<link>{{ $post.Permalink }}</link> <link>{{ $home }}{{ $post.RelPermalink }}</link>
<author>{{ $post.Params.attribution }}</author> <guid isPermaLink="true">{{ $home }}{{ $post.RelPermalink }}</guid>
<guid isPermaLink="true">{{ $post.Permalink }}</guid>
{{ range $kw := $post.Keywords }} {{ range $kw := $post.Keywords }}
<category>{{ $kw }}</category> <category>{{ $kw }}</category>
{{ end }} {{ end }}
</item> </item>
{{ end }} {{ end }}

View File

@ -1,4 +1,4 @@
{{ $home := .Site.BaseURL }} {{ $home := .Site.BaseURL | printf "%s%s" (os.Getenv "DEPLOY_PRIME_URL") }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel> <channel>
@ -9,6 +9,7 @@
{{ end }} {{ end }}
<link>{{ $home }}</link> <link>{{ $home }}</link>
<image> <image>
<title>Istio Blog and News</title>
<url>{{ $home }}/favicons/android-192x192.png</url> <url>{{ $home }}/favicons/android-192x192.png</url>
<link>{{ $home }}</link> <link>{{ $home }}</link>
</image> </image>
@ -21,14 +22,12 @@
{{ if not $post.Draft }} {{ if not $post.Draft }}
<item> <item>
<title>{{ $post.Title }}</title> <title>{{ $post.Title }}</title>
<description>{{ $post.Content | html }}</description> <description>{{ `<![CDATA[` | safeHTML }}{{ $post.Content | safeHTML }}{{ `]]>` | safeHTML }}</description>
<pubDate>{{ $post.PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> <pubDate>{{ $post.PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<link>{{ $post.Permalink }}</link> <link>{{ $home }}{{ $post.RelPermalink }}</link>
<author>{{ $post.Params.attribution }}</author> <guid isPermaLink="true">{{ $home }}{{ $post.RelPermalink }}</guid>
<guid isPermaLink="true">{{ $post.Permalink }}</guid>
{{ range $kw := $post.Keywords }} {{ range $kw := $post.Keywords }}
<category>{{ $kw }}</category> <category>{{ $kw }}</category>
{{ end }} {{ end }}
</item> </item>
{{ end }} {{ end }}
@ -41,14 +40,12 @@
{{ if and (not $post.Draft) $post.IsPage }} {{ if and (not $post.Draft) $post.IsPage }}
<item> <item>
<title>{{ $post.Title }}</title> <title>{{ $post.Title }}</title>
<description>{{ $post.Content | html }}</description> <description>{{ `<![CDATA[` | safeHTML }}{{ $post.Content | safeHTML }}{{ `]]>` | safeHTML }}</description>
<pubDate>{{ $post.PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> <pubDate>{{ $post.PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<link>{{ $post.Permalink }}</link> <link>{{ $home }}{{ $post.RelPermalink }}</link>
<author>{{ $post.Params.attribution }}</author> <guid isPermaLink="true">{{ $home }}{{ $post.RelPermalink }}</guid>
<guid isPermaLink="true">{{ $post.Permalink }}</guid>
{{ range $kw := $post.Keywords }} {{ range $kw := $post.Keywords }}
<category>{{ $kw }}</category> <category>{{ $kw }}</category>
{{ end }} {{ end }}
</item> </item>
{{ end }} {{ end }}