summaryrefslogtreecommitdiff
path: root/template/rss.xml.j2
blob: b9a29f705e6ddb4e03e9eb7b9cc986ef14fc9b6b (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{#
# Copyright (C) 2019, 2020 GNUnet e.V.
#
# This code is derived from code contributed to GNUnet eV
# by nikita <nikita@n0.is>.
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
# AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
# SPDX-License-Identifier: 0BSD
#}
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  {% for siteconfitem in siteconf %}
    <channel>
      <atom:link href="https://{{ siteconfitem['baseurl'] }}/{{ lang }}/rss.xml" rel="self" type="application/rss+xml" />
      <title>{{ siteconfitem['rsstitle'] }}</title>
      <language>{{ lang }}</language>
      <description>{{ siteconfitem['rssdescr']|e }}</description>
      <link>https://{{ siteconfitem['baseurl'] }}/</link>
      <lastBuildDate>{{ now }}</lastBuildDate>
      {% for newspostitem in newsposts %}
        <item>
          <guid>https://{{ siteconfitem['baseurl'] }}/{{ lang }}{{ siteconfitem['newsloc'] }}{{ newspostitem['page'] }}</guid>
          <link>https://{{ siteconfitem['baseurl'] }}/{{ lang }}{{ siteconfitem['newsloc'] }}{{ newspostitem['page'] }}</link>
          <pubDate>{{ conv_date_rfc822(newspostitem["date"]) }}</pubDate>
          <title>{{ newspostitem['title']|e }}</title>
          <description>
            <![CDATA[
             <article>
               {{ newspostitem['content'] }}
             </article>
             ]]>
          </description>
        </item>
      {% endfor %}
    </channel>
  {% endfor %}
</rss>