{{ $home := .Site.BaseURL }}

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Istio Blog</title>
    <description>An open platform to connect, manage, and secure microservices.</description>
    {{ if not .Date.IsZero }}
        <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>
    {{ end }}
    <link>{{ $home }}</link>
    <image>
      <url>{{ $home }}/favicons/android-192x192.png</url>
      <link>{{ $home }}</link>
    </image>

    {{ $pages := (where .Site.Pages "Section" "blog").ByPublishDate }}

    {{ range $post := $pages }}
      {{ if and (not $post.Draft) $post.IsPage }}
        <item>
          <title>{{ $post.Title }}</title>
          <description>{{ $post.Description }}</description>
          <pubDate>{{ $post.PublishDate }}</pubDate>
          <link>{{ $post.Permalink }}</link>
          <author>{{ $post.Params.attribution }}</author>
          <guid isPermaLink="true">{{ $post.Permalink }}</guid>
        </item>
      {{ end }}
    {{ end }}
  </channel>
</rss>
