Change RSS feeds (#18356)
* Change RSS feeds - Use date and time for titles instead of ellipsized text - Use full content in body, even when there is a content warning - Use media extensions * Change feed icons and add width and height attributes to custom emojis * Fix custom emoji animate on hover breaking * Fix tests
This commit is contained in:
parent
f17e73da09
commit
2b8dc58b7f
19 changed files with 311 additions and 307 deletions
29
app/lib/rss/media_content.rb
Normal file
29
app/lib/rss/media_content.rb
Normal file
|
@ -0,0 +1,29 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RSS::MediaContent < RSS::Element
|
||||
def initialize(url, type, size)
|
||||
super()
|
||||
|
||||
@root = create_element('media:content') do |content|
|
||||
content['url'] = url
|
||||
content['type'] = type
|
||||
content['fileSize'] = size
|
||||
end
|
||||
end
|
||||
|
||||
def medium(str)
|
||||
@root['medium'] = str
|
||||
end
|
||||
|
||||
def rating(str)
|
||||
append_element('media:rating', str) do |rating|
|
||||
rating['scheme'] = 'urn:simple'
|
||||
end
|
||||
end
|
||||
|
||||
def description(str)
|
||||
append_element('media:description', str) do |description|
|
||||
description['type'] = 'plain'
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue