aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl
diff options
context:
space:
mode:
authorArthur <arthur@hoa.ro>2016-03-25 19:20:55 +0100
committerArthur <arthur@hoa.ro>2016-03-25 19:20:55 +0100
commitf66a1990e5d93a6f302ce594968e5e717b93da72 (patch)
tree22e5da81979bc7ee596fcd5c9c56d4c01c599aa4 /tpl
parentb2764886c7b52ed98debb90b2ebf075dec5ae2e8 (diff)
parent528a6f8a232c060faf024008e4f8a09b4aa8dabc (diff)
downloadShaarli-f66a1990e5d93a6f302ce594968e5e717b93da72.tar.gz
Shaarli-f66a1990e5d93a6f302ce594968e5e717b93da72.tar.zst
Shaarli-f66a1990e5d93a6f302ce594968e5e717b93da72.zip
Merge pull request #515 from ArthurHoaro/template-feeds
Refactor RSS feeds generation, and do it through templates
Diffstat (limited to 'tpl')
-rw-r--r--tpl/configure.html7
-rw-r--r--tpl/feed.atom.html40
-rw-r--r--tpl/feed.rss.html34
3 files changed, 79 insertions, 2 deletions
diff --git a/tpl/configure.html b/tpl/configure.html
index 9c725a51..77c8b7d9 100644
--- a/tpl/configure.html
+++ b/tpl/configure.html
@@ -22,9 +22,12 @@
22 <input type="checkbox" name="privateLinkByDefault" id="privateLinkByDefault" {if="!empty($GLOBALS['privateLinkByDefault'])"}checked{/if}/><label for="privateLinkByDefault">&nbsp;All new links are private by default</label></td> 22 <input type="checkbox" name="privateLinkByDefault" id="privateLinkByDefault" {if="!empty($GLOBALS['privateLinkByDefault'])"}checked{/if}/><label for="privateLinkByDefault">&nbsp;All new links are private by default</label></td>
23 </tr> 23 </tr>
24 <tr> 24 <tr>
25 <td valign="top"><b>Enable RSS Permalinks</b></td> 25 <td valign="top"><b>RSS direct links</b></td>
26 <td> 26 <td>
27 <input type="checkbox" name="enableRssPermalinks" id="enableRssPermalinks" {if="!empty($GLOBALS['config']['ENABLE_RSS_PERMALINKS'])"}checked{/if}/><label for="enableRssPermalinks">&nbsp;Switches the RSS feed URLs between full URLs and shortlinks. Enabling it will show a permalink in the description, and the feed item will be linked to the absolute URL. Disabling it swaps this behaviour around (permalink in title and link in description). RSS Permalinks are currently <b>{if="$GLOBALS['config']['ENABLE_RSS_PERMALINKS']"}enabled{else}disabled{/if}</b></label> 27 <input type="checkbox" name="enableRssPermalinks" id="enableRssPermalinks" {if="!empty($GLOBALS['config']['ENABLE_RSS_PERMALINKS'])"}checked{/if}/>
28 <label for="enableRssPermalinks">
29 &nbsp;Disable it to use permalinks in RSS feed instead of direct links to your shaared links. Currently <b>{if="$GLOBALS['config']['ENABLE_RSS_PERMALINKS']"}enabled{else}disabled{/if}.</b>
30 </label>
28 </td> 31 </td>
29 </tr> 32 </tr>
30 <tr> 33 <tr>
diff --git a/tpl/feed.atom.html b/tpl/feed.atom.html
new file mode 100644
index 00000000..2ebb162a
--- /dev/null
+++ b/tpl/feed.atom.html
@@ -0,0 +1,40 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<feed xmlns="http://www.w3.org/2005/Atom">
3 <title>{$pagetitle}</title>
4 <subtitle>Shaared links</subtitle>
5 {if="$show_dates"}
6 <updated>{$last_update}</updated>
7 {/if}
8 <link rel="self" href="{$self_link}#" />
9 {if="!empty($pubsubhub_url)"}
10 <!-- PubSubHubbub Discovery -->
11 <link rel="hub" href="{$pubsubhub_url}#" />
12 <!-- End Of PubSubHubbub Discovery -->
13 {/if}
14 <author>
15 <name>{$index_url}</name>
16 <uri>{$index_url}</uri>
17 </author>
18 <id>{$index_url}</id>
19 <generator>Shaarli</generator>
20 {loop="links"}
21 <entry>
22 <title>{$value.title}</title>
23 {if="$usepermalinks"}
24 <link href="{$value.guid}#" />
25 {else}
26 <link href="{$value.url}#" />
27 {/if}
28 <id>{$value.guid}</id>
29 {if="$show_dates"}
30 <updated>{$value.iso_date}</updated>
31 {/if}
32 <content type="html" xml:lang="{$language}">
33 <![CDATA[{$value.description}]]>
34 </content>
35 {loop="$value.taglist"}
36 <category scheme="{$index_url}?searchtags=" term="{$value|strtolower}" label="{$value}" />
37 {/loop}
38 </entry>
39 {/loop}
40</feed>
diff --git a/tpl/feed.rss.html b/tpl/feed.rss.html
new file mode 100644
index 00000000..26de7f19
--- /dev/null
+++ b/tpl/feed.rss.html
@@ -0,0 +1,34 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
3 <channel>
4 <title>{$pagetitle}</title>
5 <link>{$index_url}</link>
6 <description>Shaared links</description>
7 <language>{$language}</language>
8 <copyright>{$index_url}</copyright>
9 <generator>Shaarli</generator>
10 <atom:link rel="self" href="{$self_link}" />
11 {if="!empty($pubsubhub_url)"}
12 <!-- PubSubHubbub Discovery -->
13 <atom:link rel="hub" href="{$pubsubhub_url}" />
14 {/if}
15 {loop="links"}
16 <item>
17 <title>{$value.title}</title>
18 <guid isPermaLink="{if="$usepermalinks"}true{else}false{/if}">{$value.guid}</guid>
19 {if="$usepermalinks"}
20 <link>{$value.guid}</link>
21 {else}
22 <link>{$value.url}</link>
23 {/if}
24 {if="$show_dates"}
25 <pubDate>{$value.iso_date}</pubDate>
26 {/if}
27 <description><![CDATA[{$value.description}]]></description>
28 {loop="$value.taglist"}
29 <category domain="{$index_url}?searchtags=">{$value}</category>
30 {/loop}
31 </item>
32 {/loop}
33 </channel>
34</rss>