forked from AkkomaGang/akkoma
Compare commits
2 commits
develop
...
feed-tag-t
Author | SHA1 | Date | |
---|---|---|---|
5e7e126ff1 | |||
f7bc264f2e |
6 changed files with 120 additions and 64 deletions
|
@ -1,13 +1,22 @@
|
|||
<entry>
|
||||
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
|
||||
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
||||
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
|
||||
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
||||
<id><%= @data["id"] %></id>
|
||||
<title><%= activity_title(@data, Keyword.get(@feed_config, :post_title, %{})) %></title>
|
||||
<content type="html"><%= activity_content(@data) %></content>
|
||||
<published><%= @activity.data["published"] %></published>
|
||||
<updated><%= @activity.data["published"] %></updated>
|
||||
|
||||
<%= render @view_module, "_tag_author.atom", assigns %>
|
||||
<%= render @view_module, "_tag_author.atom", assigns %>
|
||||
|
||||
<id><%= @data["id"] %></id>
|
||||
<title><%= activity_title(@data, Keyword.get(@feed_config, :post_title, %{})) %></title>
|
||||
<content type="html"><%= activity_content(@data) %></content>
|
||||
<ostatus:conversation ref="<%= activity_context(@activity) %>">
|
||||
<%= activity_context(@activity) %>
|
||||
</ostatus:conversation>
|
||||
<link href="<%= activity_context(@activity) %>" rel="ostatus:conversation"/>
|
||||
|
||||
<%= if @data["summary"] do %>
|
||||
<summary><%= escape(@data["summary"]) %></summary>
|
||||
<% end %>
|
||||
<%= if @activity.local do %>
|
||||
<link type="application/atom+xml" href='<%= @data["id"] %>' rel="self"/>
|
||||
<link type="text/html" href='<%= @data["id"] %>' rel="alternate"/>
|
||||
|
@ -15,37 +24,29 @@
|
|||
<link type="text/html" href='<%= @data["external_url"] %>' rel="alternate"/>
|
||||
<% end %>
|
||||
|
||||
<published><%= @activity.data["published"] %></published>
|
||||
<updated><%= @activity.data["published"] %></updated>
|
||||
<%= for tag <- Pleroma.Object.hashtags(@object) do %>
|
||||
<category term="<%= tag %>"></category>
|
||||
<% end %>
|
||||
|
||||
<ostatus:conversation ref="<%= activity_context(@activity) %>">
|
||||
<%= activity_context(@activity) %>
|
||||
</ostatus:conversation>
|
||||
<link href="<%= activity_context(@activity) %>" rel="ostatus:conversation"/>
|
||||
<%= for attachment <- @data["attachment"] || [] do %>
|
||||
<link rel="enclosure" href="<%= attachment_href(attachment) %>" type="<%= attachment_type(attachment) %>"/>
|
||||
<% end %>
|
||||
|
||||
<%= if @data["summary"] do %>
|
||||
<summary><%= @data["summary"] %></summary>
|
||||
<% end %>
|
||||
<%= if @data["inReplyTo"] do %>
|
||||
<thr:in-reply-to ref='<%= @data["inReplyTo"] %>' href='<%= get_href(@data["inReplyTo"]) %>'/>
|
||||
<% end %>
|
||||
|
||||
<%= for id <- @activity.recipients do %>
|
||||
<%= if id == Pleroma.Constants.as_public() do %>
|
||||
<link rel="mentioned"
|
||||
ostatus:object-type="http://activitystrea.ms/schema/1.0/collection"
|
||||
href="http://activityschema.org/collection/public"/>
|
||||
<% else %>
|
||||
<%= unless Regex.match?(~r/^#{Pleroma.Web.Endpoint.url()}.+followers$/, id) do %>
|
||||
<link rel="mentioned"
|
||||
ostatus:object-type="http://activitystrea.ms/schema/1.0/person"
|
||||
href="<%= id %>" />
|
||||
<% end %>
|
||||
<%= for id <- @activity.recipients do %>
|
||||
<%= if id == Pleroma.Constants.as_public() do %>
|
||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection" href="http://activityschema.org/collection/public"/>
|
||||
<% else %>
|
||||
<%= unless Regex.match?(~r/^#{Pleroma.Web.Endpoint.url()}.+followers$/, id) do %>
|
||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person" href="<%= id %>"/>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= for tag <- Pleroma.Object.hashtags(@object) do %>
|
||||
<category term="<%= tag %>"></category>
|
||||
<% end %>
|
||||
|
||||
<%= for {emoji, file} <- @data["emoji"] || %{} do %>
|
||||
<link name="<%= emoji %>" rel="emoji" href="<%= file %>"/>
|
||||
<% end %>
|
||||
<%= for {emoji, file} <- @data["emoji"] || %{} do %>
|
||||
<link name="<%= emoji %>" rel="emoji" href="<%= file %>"/>
|
||||
<% end %>
|
||||
</entry>
|
||||
|
|
53
lib/pleroma/web/templates/feed/feed/_tag_activity.rss.eex
Normal file
53
lib/pleroma/web/templates/feed/feed/_tag_activity.rss.eex
Normal file
|
@ -0,0 +1,53 @@
|
|||
<item>
|
||||
<activity:object-type>http://activitystrea.ms/schema/1.0/note</activity:object-type>
|
||||
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
||||
<guid><%= @data["id"] %></guid>
|
||||
<title><%= activity_title(@data, Keyword.get(@feed_config, :post_title, %{})) %></title>
|
||||
<description><%= activity_content(@data) %></description>
|
||||
<pubDate><%= @activity.data["published"] %></pubDate>
|
||||
<updated><%= @activity.data["published"] %></updated>
|
||||
|
||||
<%= render @view_module, "_tag_author.rss", assigns %>
|
||||
|
||||
<ostatus:conversation ref="<%= activity_context(@activity) %>">
|
||||
<%= activity_context(@activity) %>
|
||||
</ostatus:conversation>
|
||||
|
||||
<%= if @data["summary"] do %>
|
||||
<description><%= escape(@data["summary"]) %></description>
|
||||
<% end %>
|
||||
|
||||
<%= if @activity.local do %>
|
||||
<link><%= @data["id"] %></link>
|
||||
<% else %>
|
||||
<link><%= @data["external_url"] %></link>
|
||||
<% end %>
|
||||
|
||||
<link rel="ostatus:conversation"><%= activity_context(@activity) %></link>
|
||||
|
||||
<%= for tag <- Pleroma.Object.hashtags(@object) do %>
|
||||
<category term="<%= tag %>"></category>
|
||||
<% end %>
|
||||
|
||||
<%= for attachment <- @data["attachment"] || [] do %>
|
||||
<link type="<%= attachment_type(attachment) %>"><%= attachment_href(attachment) %></link>
|
||||
<% end %>
|
||||
|
||||
<%= if @data["inReplyTo"] do %>
|
||||
<thr:in-reply-to ref='<%= @data["inReplyTo"] %>' href='<%= get_href(@data["inReplyTo"]) %>'/>
|
||||
<% end %>
|
||||
|
||||
<%= for id <- @activity.recipients do %>
|
||||
<%= if id == Pleroma.Constants.as_public() do %>
|
||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/collection">http://activityschema.org/collection/public</link>
|
||||
<% else %>
|
||||
<%= unless Regex.match?(~r/^#{Pleroma.Web.Endpoint.url()}.+followers$/, id) do %>
|
||||
<link rel="mentioned" ostatus:object-type="http://activitystrea.ms/schema/1.0/person"><%= id %></link>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<%= for {emoji, file} <- @data["emoji"] || %{} do %>
|
||||
<link name="<%= emoji %>" rel="emoji"><%= file %></link>
|
||||
<% end %>
|
||||
</item>
|
|
@ -1,14 +0,0 @@
|
|||
<item>
|
||||
<title><%= activity_title(@data, Keyword.get(@feed_config, :post_title, %{})) %></title>
|
||||
|
||||
|
||||
<guid isPermalink="true"><%= activity_context(@activity) %></guid>
|
||||
<link><%= activity_context(@activity) %></link>
|
||||
<pubDate><%= pub_date(@activity.data["published"]) %></pubDate>
|
||||
|
||||
<description><%= activity_content(@data) %></description>
|
||||
<%= for attachment <- @data["attachment"] || [] do %>
|
||||
<enclosure url="<%= attachment_href(attachment) %>" type="<%= attachment_type(attachment) %>"/>
|
||||
<% end %>
|
||||
|
||||
</item>
|
|
@ -1,18 +1,17 @@
|
|||
<author>
|
||||
<activity:object-type>http://activitystrea.ms/schema/1.0/person</activity:object-type>
|
||||
<id><%= @actor.ap_id %></id>
|
||||
<uri><%= @actor.ap_id %></uri>
|
||||
<name><%= @actor.nickname %></name>
|
||||
<summary><%= escape(@actor.bio) %></summary>
|
||||
<link rel="avatar" href="<%= User.avatar_url(@actor) %>"/>
|
||||
<%= if User.banner_url(@actor) do %>
|
||||
<link rel="header" href="<%= User.banner_url(@actor) %>"/>
|
||||
<% end %>
|
||||
<%= if @actor.local do %>
|
||||
<ap_enabled>true</ap_enabled>
|
||||
<% end %>
|
||||
|
||||
<poco:preferredUsername><%= @actor.nickname %></poco:preferredUsername>
|
||||
<poco:displayName><%= @actor.name %></poco:displayName>
|
||||
<poco:note><%= escape(@actor.bio) %></poco:note>
|
||||
<id><%= @actor.ap_id %></id>
|
||||
<activity:object>http://activitystrea.ms/schema/1.0/person</activity:object>
|
||||
<uri><%= @actor.ap_id %></uri>
|
||||
<poco:preferredUsername><%= @actor.nickname %></poco:preferredUsername>
|
||||
<poco:displayName><%= @actor.name %></poco:displayName>
|
||||
<poco:note><%= escape(@actor.bio) %></poco:note>
|
||||
<summary><%= escape(@actor.bio) %></summary>
|
||||
<name><%= @actor.nickname %></name>
|
||||
<link rel="avatar" href="<%= User.avatar_url(@actor) %>"/>
|
||||
<%= if User.banner_url(@actor) do %>
|
||||
<link rel="header" href="<%= User.banner_url(@actor) %>"/>
|
||||
<% end %>
|
||||
<%= if @actor.local do %>
|
||||
<ap_enabled>true</ap_enabled>
|
||||
<% end %>
|
||||
</author>
|
||||
|
|
17
lib/pleroma/web/templates/feed/feed/_tag_author.rss.eex
Normal file
17
lib/pleroma/web/templates/feed/feed/_tag_author.rss.eex
Normal file
|
@ -0,0 +1,17 @@
|
|||
<managingEditor>
|
||||
<guid><%= @actor.ap_id %></guid>
|
||||
<activity:object>http://activitystrea.ms/schema/1.0/person</activity:object>
|
||||
<uri><%= @actor.ap_id %></uri>
|
||||
<poco:preferredUsername><%= @actor.nickname %></poco:preferredUsername>
|
||||
<poco:displayName><%= @actor.name %></poco:displayName>
|
||||
<poco:note><%= escape(@actor.bio) %></poco:note>
|
||||
<description><%= escape(@actor.bio) %></description>
|
||||
<name><%= @actor.nickname %></name>
|
||||
<link rel="avatar"><%= User.avatar_url(@actor) %></link>
|
||||
<%= if User.banner_url(@actor) do %>
|
||||
<link rel="header"><%= User.banner_url(@actor) %></link>
|
||||
<% end %>
|
||||
<%= if @actor.local do %>
|
||||
<ap_enabled>true</ap_enabled>
|
||||
<% end %>
|
||||
</managingEditor>
|
|
@ -9,7 +9,7 @@
|
|||
<webfeeds:logo><%= feed_logo() %></webfeeds:logo>
|
||||
<webfeeds:accentColor>2b90d9</webfeeds:accentColor>
|
||||
<%= for activity <- @activities do %>
|
||||
<%= render @view_module, "_tag_activity.xml", Map.merge(assigns, prepare_activity(activity)) %>
|
||||
<%= render @view_module, "_tag_activity.rss", Map.merge(assigns, prepare_activity(activity, actor: true)) %>
|
||||
<% end %>
|
||||
</channel>
|
||||
</rss>
|
||||
|
|
Loading…
Reference in a new issue