diff options
author | ng0 <ng0@n0.is> | 2019-02-28 10:47:33 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-02-28 10:47:33 +0000 |
commit | ad6f053c18b9c8396182ce843d178c97f4fa49af (patch) | |
tree | c8e4f2a415784bf8673881330a0c0e8f1218ab24 | |
parent | 2466c4a84fc936fa439f9b59a5673059e58405fc (diff) |
Add drafty, unfinished, unused files for rss
-rw-r--r-- | templates/feed-atom.py | 4 | ||||
-rw-r--r-- | templates/feed.atom.j2 | 12 | ||||
-rw-r--r-- | templates/feed.xml | 15 |
3 files changed, 31 insertions, 0 deletions
diff --git a/templates/feed-atom.py b/templates/feed-atom.py new file mode 100644 index 00000000..37a596c4 --- /dev/null +++ b/templates/feed-atom.py @@ -0,0 +1,4 @@ +import jinja2 + +env = jinja2.Environment(loader=jinja2.FileSystemLoader(".")) +print(env.get_template("feed.rss.j2").render(items=get_list_of_items())) diff --git a/templates/feed.atom.j2 b/templates/feed.atom.j2 new file mode 100644 index 00000000..0a201ff2 --- /dev/null +++ b/templates/feed.atom.j2 @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8" ?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <author>Author's name</author</author> + <title>Feed title</title> + {% for item in items %} + <entry> + <title>{{ item[0] }}</title> + <link href="{{ item[1] }}" /> + <content type="html">{{ item[2] }}</content> + </entry> + {% endfor %} +</feed> diff --git a/templates/feed.xml b/templates/feed.xml new file mode 100644 index 00000000..e509fd10 --- /dev/null +++ b/templates/feed.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8" ?> +<rss version="2.0"> + <channel> + <title>{{ title }}</title> + <link>{{ site_url }}</link> + <description>gnunet.org feed</description> + {% for item in items %} + <item> + <title>{{ item[0] }}</title> + <link href="{{ item[1] }}" /> + <content type="html">{{ item[2] }}</content> + </item> + {% endfor %} + </channel> +</rss> |