File: feed.xml

package info (click to toggle)
python-tornado 6.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 3,176 kB
  • sloc: python: 28,920; javascript: 156; sh: 100; ansic: 72; xml: 49; makefile: 49; sql: 23
file content (26 lines) | stat: -rw-r--r-- 1,363 bytes parent folder | download | duplicates (2)
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.now(datetime.timezone.utc).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>