Fix feed.xml generation. (#813)

Fixes #812
This commit is contained in:
Martin Taillefer 2017-12-20 11:27:52 -08:00 committed by Laurent Demailly
parent 569d911acd
commit f6216a59d0
1 changed files with 28 additions and 18 deletions

View File

@ -1,29 +1,39 @@
--- ---
layout: null layout: null
--- ---
{% include home.html %} {%- assign root = "https://istio.io" -%}
<?xml version="1.0"?>
<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>
<title>Istio</title> <title>Istio Blog</title>
<description>An open platform to connect, manage, and secure microservices.</description> <description>An open platform to connect, manage, and secure microservices.</description>
<pubDate>{{ site.time | date_to_xmlschema }}</pubDate> <pubDate>{{ site.time | date_to_xmlschema }}</pubDate>
<link>{{home}}/index.html</link> <link>{{root}}</link>
<image> <image>
<url>img/android-chrome-96x96.png</url> <url>{{root}}/favicons/android-192x192.png</url>
<link>{{home}}/index.html</link> <link>{{root}}</link>
</image> </image>
{% for post in site.posts %}
{% unless post.draft %} {%- assign sorted = site.blog | sort: "url" -%}
<item> {%- for post in sorted -%}
<title>{{ post.title | xml_escape }}</title> {%- if post.draft == true -%}
<description>{{ post.overview | xml_escape }}</description> {%- continue -%}
<pubDate>{{ post.date | date_to_xmlschema }}</pubDate> {%- endif -%}
<link>{{ post.url | prepend: site.github.url }}</link>
<author>{{ post.attribution }}</author> {%- assign path = post.url | split: "/" -%}
<guid isPermaLink="true">{{ post.url | prepend: site.github.url }}</guid> {%- assign name = path | last -%}
</item> {%- if name == "index.html" -%}
{% endunless %} {%- continue -%}
{% endfor %} {% endif %}
<item>
<title>{{ post.title | xml_escape }}</title>
<description>{{ post.overview | xml_escape }}</description>
<pubDate>{{ post.publish_date | date_to_xmlschema }}</pubDate>
<link>{{root}}{{ post.url }}</link>
<author>{{ post.attribution }}</author>
<guid isPermaLink="true">{{root}}{{ post.url }}</guid>
</item>
{%- endfor -%}
</channel> </channel>
</rss> </rss>