Files
danbooru/app/views/comments/index.atom.builder
evazion e04892fb38 posts: use 180x180 thumbnails in place of 150x150 thumbnails.
For small thumbnails, use 180x180 thumbnails scaled down to 150x150.
This is so we can get rid of 150x150 images and just use 180x180 for
both small and medium size thumbnails.

Also fix RSS feeds, XML sitemaps, and Discord embeds to use 360x360
thumbnails instead of 150x150 thumbnails.
2021-12-13 05:23:38 -06:00

26 lines
1.0 KiB
Ruby

atom_feed(root_url: comments_url(host: Danbooru.config.hostname)) do |feed|
title = "Comments"
title += " by #{params[:search][:creator_name]}" if params.dig(:search, :creator_name).present?
title += " on #{params[:search][:post_tags_match]}" if params.dig(:search, :post_tags_match).present?
title += " on post ##{params[:search][:post_id]}" if params.dig(:search, :post_id).present?
feed.title(title)
feed.updated(@comments.first.try(:updated_at))
@comments.each do |comment|
feed.entry(comment, published: comment.created_at, updated: comment.updated_at) do |entry|
entry.title("@#{comment.creator.name} on post ##{comment.post_id} (#{comment.post.presenter.humanized_essential_tag_string})")
entry.content(<<-EOS.strip_heredoc, type: "html")
<img src="#{comment.post.media_asset.variant("360x360").file_url}"/>
#{format_text(comment.body)}
EOS
entry.author do |author|
author.name(comment.creator.name)
author.uri(user_url(comment.creator))
end
end
end
end