]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Create a template to handle ATOM feed
authorArthurHoaro <arthur@hoa.ro>
Thu, 10 Mar 2016 17:46:07 +0000 (18:46 +0100)
committerArthurHoaro <arthur@hoa.ro>
Fri, 18 Mar 2016 18:13:48 +0000 (19:13 +0100)
ATOM feed improvement:

  * Adds a subtitle to match RSS feed behavior.
  * Better syntax for categories (see http://edward.oconnor.cx/2007/02/representing-tags-in-atom ).
  * Use locale to set the language

tpl/feed.atom.html [new file with mode: 0644]

diff --git a/tpl/feed.atom.html b/tpl/feed.atom.html
new file mode 100644 (file)
index 0000000..2ebb162
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+  <title>{$pagetitle}</title>
+  <subtitle>Shaared links</subtitle>
+  {if="$show_dates"}
+    <updated>{$last_update}</updated>
+  {/if}
+  <link rel="self" href="{$self_link}#" />
+  {if="!empty($pubsubhub_url)"}
+    <!-- PubSubHubbub Discovery -->
+    <link rel="hub" href="{$pubsubhub_url}#" />
+    <!-- End Of PubSubHubbub Discovery -->
+  {/if}
+  <author>
+    <name>{$index_url}</name>
+    <uri>{$index_url}</uri>
+  </author>
+  <id>{$index_url}</id>
+  <generator>Shaarli</generator>
+  {loop="links"}
+    <entry>
+      <title>{$value.title}</title>
+      {if="$usepermalinks"}
+        <link href="{$value.guid}#" />
+      {else}
+        <link href="{$value.url}#" />
+      {/if}
+      <id>{$value.guid}</id>
+      {if="$show_dates"}
+        <updated>{$value.iso_date}</updated>
+      {/if}
+      <content type="html" xml:lang="{$language}">
+        <![CDATA[{$value.description}]]>
+      </content>
+      {loop="$value.taglist"}
+        <category scheme="{$index_url}?searchtags=" term="{$value|strtolower}" label="{$value}" />
+      {/loop}
+    </entry>
+  {/loop}
+</feed>