forked from tornadoweb/tornado
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfeed.xml
26 lines (26 loc) · 1.31 KB
/
feed.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
{% set date_format = "%Y-%m-%dT%H:%M:%SZ" %}
<title>{{ handler.settings["blog_title"] }}</title>
{% if len(entries) > 0 %}
<updated>{{ max(e.updated for e in entries).strftime(date_format) }}</updated>
{% else %}
<updated>{{ datetime.datetime.utcnow().strftime(date_format) }}</updated>
{% end %}
<id>http://{{ request.host }}/</id>
<link rel="alternate" href="http://{{ request.host }}/" title="{{ handler.settings["blog_title"] }}" type="text/html"/>
<link rel="self" href="{{ request.full_url() }}" title="{{ handler.settings["blog_title"] }}" type="application/atom+xml"/>
<author><name>{{ handler.settings["blog_title"] }}</name></author>
{% for entry in entries %}
<entry>
<id>http://{{ request.host }}/entry/{{ entry.slug }}</id>
<title type="text">{{ entry.title }}</title>
<link href="http://{{ request.host }}/entry/{{ entry.slug }}" rel="alternate" type="text/html"/>
<updated>{{ entry.updated.strftime(date_format) }}</updated>
<published>{{ entry.published.strftime(date_format) }}</published>
<content type="xhtml" xml:base="http://{{ request.host }}/">
<div xmlns="http://www.w3.org/1999/xhtml">{% raw entry.html %}</div>
</content>
</entry>
{% end %}
</feed>