Make RSS feed entry links valid and accessible

According to the ATOM spec link elements must have a href:
https://validator.w3.org/feed/docs/atom.html

Also most feed readers (TinyTiny, Feedly, Thunderbird) prefer link elements in
this order:

- plain
- with attribute rel=alternate
- with attribute rel=via

As the content is work of the entry author, link to it by default. Not to the
wallabag instance entry.

This also makes it possible to share links with people who don't have access to
the wallabag instance via the RSS feed.
This commit is contained in:
Henne Vogelsang 2021-07-08 22:36:50 +02:00
parent 7b17dfc172
commit 23de687696
No known key found for this signature in database
GPG key ID: 97DDB66BDAF8D4D6

View file

@ -31,9 +31,11 @@
{% for entry in entries %}
<entry>
<title><![CDATA[{{ entry.title|e }}]]></title>
<link href="{{ entry.url }}"/>
<link rel="alternate" type="text/html"
href="{{ url('view', {'id': entry.id}) }}"/>
<link rel="via">{{ entry.url }}</link>
<link rel="via"
href="{{ entry.url }}"/>
<id>wallabag:{{ domainName | removeScheme | removeWww }}:{{ user }}:entry:{{ entry.id }}</id>
<updated>{{ entry.updatedAt|date('c') }}</updated>
<published>{{ entry.createdAt|date('c') }}</published>