start_sf5_project_reboot/app/templates/blog/index.xml.twig

26 lines
1.1 KiB
Twig

<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>{{ 'rss.title'|trans }}</title>
<description>{{ 'rss.description'|trans }}</description>
<pubDate>{{ 'now'|date('r', timezone='GMT') }}</pubDate>
<lastBuildDate>{{ (paginator.results|last).publishedAt|default('now')|date('r', timezone='GMT') }}</lastBuildDate>
<link>{{ url('blog_index') }}</link>
<language>{{ app.request.locale }}</language>
{% for post in paginator.results %}
<item>
<title>{{ post.title }}</title>
<description>{{ post.summary }}</description>
<link>{{ url('blog_post', {'slug': post.slug}) }}</link>
<guid>{{ url('blog_post', {'slug': post.slug}) }}</guid>
<pubDate>{{ post.publishedAt|date(format='r', timezone='GMT') }}</pubDate>
<author>{{ post.author.email }}</author>
{% for tag in post.tags %}
<category>{{ tag.name }}</category>
{% endfor %}
</item>
{% endfor %}
</channel>
</rss>