diff --git a/lib/bamboo.rb b/lib/bamboo.rb index 158693d..de27dbf 100644 --- a/lib/bamboo.rb +++ b/lib/bamboo.rb @@ -33,6 +33,10 @@ def index(coll, name) halt 307, {'Location' => 'http://github.com/mikedouglas'}, '' end + get '/feed' do + Template.new('atom.xml').render({'posts' => @posts, 'site' => @site}) + end + get '/posts' do index @posts, 'posts' end diff --git a/templates/atom.xml b/templates/atom.xml new file mode 100644 index 0000000..36f4072 --- /dev/null +++ b/templates/atom.xml @@ -0,0 +1,26 @@ + + + entropy.io + + + {{ site.time | date_to_xmlschema }} + {{ site.url }} + + {{ site.author }} + {{ site.email }} + + + {% for post in site.posts %} + + {{ site.url }}{{ post.url }} + + {{ post.title }} + {{ post.date | date_to_xmlschema }} + + {{ site.author }} + {{ site.url }} + + {{ post.content | xml_escape }} + + {% endfor %} +