fix(feed): complete Atom XML metadata
This commit is contained in:
parent
5f71532442
commit
c5230d98c5
6 changed files with 75 additions and 4 deletions
|
|
@ -43,7 +43,7 @@ defmodule Pleroma.Web.Feed.FeedView do
|
|||
def most_recent_update(activities, :rss) do
|
||||
activities
|
||||
|> Enum.map(fn activity ->
|
||||
case Object.normalize(activity, fetch: false) do
|
||||
case activity.object do
|
||||
%Object{updated_at: updated_at} -> updated_at
|
||||
_ -> activity.updated_at
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<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>
|
||||
<id><%= @data["id"] %></id>
|
||||
<id><%= escape(@data["id"] || "") %></id>
|
||||
<title><%= activity_title(@data, Keyword.get(@feed_config, :post_title, %{})) %></title>
|
||||
<content type="html"><%= escape(atom_content_encoded(@data)) %></content>
|
||||
<published><%= to_rfc3339(@data["published"]) %></published>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<%= render Phoenix.Controller.view_module(@conn), "_tag_author.atom", assigns %>
|
||||
|
||||
<id><%= @data["id"] %></id>
|
||||
<id><%= escape(@data["id"] || "") %></id>
|
||||
<title><%= activity_title(@data, Keyword.get(@feed_config, :post_title, %{})) %></title>
|
||||
<content type="html"><%= escape(atom_content_encoded(@data)) %></content>
|
||||
<published><%= to_rfc3339(@data["published"]) %></published>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<subtitle><%= subtitle %></subtitle>
|
||||
<% end %>
|
||||
<logo><%= feed_logo() %></logo>
|
||||
<updated><%= most_recent_update(@activities) %></updated>
|
||||
<updated><%= most_recent_update(@activities) || to_rfc3339(NaiveDateTime.utc_now()) %></updated>
|
||||
<link rel="self" href="<%= feed_self_url(@conn) %>" type="application/atom+xml"/>
|
||||
|
||||
<%= for activity <- @activities do %>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue