diff options
-rwxr-xr-x | generate.py | 1 | ||||
-rw-r--r-- | templates/blog.atom.xml | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/generate.py b/generate.py index 3c7f1f3..b18e1c2 100755 --- a/generate.py +++ b/generate.py @@ -134,6 +134,7 @@ def main(argv=['generate.py']): 'posts': posts, } output('blog.html', env.get_template('blog.html').render(page=page)) + output('blog.atom.xml', env.get_template('blog.atom.xml').render(page=page)) projects = glob(os.path.join(CONTENT, 'projects', '*')) projects = [p for p in projects if not os.path.split(p)[1].startswith('_')] diff --git a/templates/blog.atom.xml b/templates/blog.atom.xml new file mode 100644 index 0000000..c506670 --- /dev/null +++ b/templates/blog.atom.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <id>https://the-tk.com/blog.html</id> + <title>the-tk.com - Blog</title> + <updated>{{ page.posts[0].date|datefmt }}T00:00:00Z</updated> + <author> + <name>Tomasz Kramkowski</name> + <email>tk@the-tk.com</email> + <uri>https://the-tk.com/</uri> + </author> + <link rel="self" href="https://the-tk.com/blog.atom.xml" /> + <link rel="alternate" href="https://the-tk.com/blog.html" /> + {% for post in page.posts %}<entry> + <title>{{ post.title }}</title> + <link rel="alternate" href="{{ site.baseurl }}/{{ post.location }}" /> + <id>{{ site.baseurl }}/{{ post.location }}</id> + <updated>{{ post.date|datefmt }}T00:00:00Z</updated> + <summary>{{ post.pre }}</summary> + </entry> + {% endfor %} +</feed> |