diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2019-12-17 22:13:45 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2019-12-18 09:19:37 +0300 |
commit | b53573a837e606ef3536ec338510cadacab55d7c (patch) | |
tree | 61006ec6103d13e471cbce2602e9e681fb6f70c2 /lib/pleroma/web/templates | |
parent | a879c396bb3a07929d4821ef2c29610808962c6d (diff) | |
download | pleroma-b53573a837e606ef3536ec338510cadacab55d7c.tar.gz |
add tag feeds
Diffstat (limited to 'lib/pleroma/web/templates')
-rw-r--r-- | lib/pleroma/web/templates/feed/feed/_tag_activity.xml.eex | 15 | ||||
-rw-r--r-- | lib/pleroma/web/templates/feed/feed/tag.xml.eex | 21 |
2 files changed, 28 insertions, 8 deletions
diff --git a/lib/pleroma/web/templates/feed/feed/_tag_activity.xml.eex b/lib/pleroma/web/templates/feed/feed/_tag_activity.xml.eex new file mode 100644 index 000000000..295574df1 --- /dev/null +++ b/lib/pleroma/web/templates/feed/feed/_tag_activity.xml.eex @@ -0,0 +1,15 @@ +<item> + <title><%= activity_title(@object, Keyword.get(@feed_config, :post_title, %{})) %></title> + + + <guid isPermalink="true"><%= activity_context(@activity) %></guid> + <link><%= activity_context(@activity) %></link> + <pubDate><%= pub_date(@data["published"]) %></pubDate> + + <description><%= activity_content(@object) %></description> + <%= for attachment <- @data["attachment"] || [] do %> + <enclosure url="<%= attachment_href(attachment) %>" type="<%= attachment_type(attachment) %>"/> + <% end %> + +</item> + diff --git a/lib/pleroma/web/templates/feed/feed/tag.xml.eex b/lib/pleroma/web/templates/feed/feed/tag.xml.eex index 52b1d7b7d..eeda01a04 100644 --- a/lib/pleroma/web/templates/feed/feed/tag.xml.eex +++ b/lib/pleroma/web/templates/feed/feed/tag.xml.eex @@ -1,10 +1,15 @@ <?xml version="1.0" encoding="UTF-8"?> -<feed - xmlns="http://www.w3.org/2005/Atom" - xmlns:thr="http://purl.org/syndication/thread/1.0" - xmlns:activity="http://activitystrea.ms/spec/1.0/" - xmlns:poco="http://portablecontacts.net/spec/1.0" - xmlns:ostatus="http://ostatus.org/schema/1.0"> +<rss version="2.0" xmlns:webfeeds="http://webfeeds.org/rss/1.0"> + <channel> - <title>TAGS</title> -</feed> + + <title>#<%= @tag %></title> + <description>These are public toots tagged with #<%= @tag %>. You can interact with them if you have an account anywhere in the fediverse.</description> + <link><%= '#{tag_feed_url(@conn, :feed, @tag)}.rss' %></link> + <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)) %> + <% end %> + </channel> +</rss> |