summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2019-03-22 21:06:42 +0000
committerTomasz Kramkowski <tk@the-tk.com>2019-03-22 21:06:42 +0000
commit2028f4e2e999c2fa3155ddabc1942bb7ff20f02f (patch)
tree959697a26c9a0dbe832080c0f2f10a8ca7faafb3
parentfc8a6007d4da624e2fae80bb5476d76c5b9010ea (diff)
downloadthe-tk.com-2028f4e2e999c2fa3155ddabc1942bb7ff20f02f.tar.gz
the-tk.com-2028f4e2e999c2fa3155ddabc1942bb7ff20f02f.tar.xz
the-tk.com-2028f4e2e999c2fa3155ddabc1942bb7ff20f02f.zip
Add atom feed generation
-rwxr-xr-xgenerate.py1
-rw-r--r--templates/blog.atom.xml21
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>