diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 242cbc151..9a52e69b6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -297,6 +297,10 @@ module ApplicationHelper end end + def atom_feed_tag(title, url = {}) + content_for(:html_header, auto_discovery_link_tag(:atom, url, title: title)) + end + def show_moderation_notice? CurrentUser.can_approve_posts? && (cookies[:moderated].blank? || Time.at(cookies[:moderated].to_i) < 72.hours.ago) end diff --git a/app/views/comments/_index_by_comment.html.erb b/app/views/comments/_index_by_comment.html.erb index 478c06557..8acbeeda9 100644 --- a/app/views/comments/_index_by_comment.html.erb +++ b/app/views/comments/_index_by_comment.html.erb @@ -16,5 +16,3 @@ <%= numbered_paginator(@comments) %> - -<% content_for(:html_header, auto_discovery_link_tag(:atom, comments_url(format: "atom"), title: "Comments")) %> diff --git a/app/views/comments/_index_by_post.html.erb b/app/views/comments/_index_by_post.html.erb index 551f63c2b..29acbe032 100644 --- a/app/views/comments/_index_by_post.html.erb +++ b/app/views/comments/_index_by_post.html.erb @@ -1,5 +1,3 @@ -<% meta_description "See comments on #{Danbooru.config.app_name}." %> -
<% if !CurrentUser.user.is_builder? %>
@@ -24,5 +22,3 @@
<%= numbered_paginator(@posts) %> - -<% content_for(:html_header, auto_discovery_link_tag(:atom, comments_url(:atom, search: { do_not_bump_post: true }), title: "Comments")) %> diff --git a/app/views/comments/index.html.erb b/app/views/comments/index.html.erb index c473d03cd..56b62ba3c 100644 --- a/app/views/comments/index.html.erb +++ b/app/views/comments/index.html.erb @@ -1,3 +1,8 @@ +<% meta_description "See comments on #{Danbooru.config.app_name}." %> + +<% atom_feed_tag "Comments", comments_url(:atom, search: params.fetch(:search, {}).permit!) %> +<%= render "secondary_links" %> +

Comments

@@ -11,5 +16,3 @@ <% end %>
- -<%= render "secondary_links" %> diff --git a/app/views/forum_topics/index.html.erb b/app/views/forum_topics/index.html.erb index 3c6560e35..ba4393780 100644 --- a/app/views/forum_topics/index.html.erb +++ b/app/views/forum_topics/index.html.erb @@ -1,4 +1,6 @@ <% page_title "Forum" %> + +<% atom_feed_tag "Forum Topics", forum_topics_url(:atom, search: params.fetch(:search, {}).permit!) %> <%= render "secondary_links" %>
@@ -19,5 +21,3 @@ <%= numbered_paginator(@forum_topics) %>
- -<% content_for(:html_header, auto_discovery_link_tag(:atom, forum_topics_url(:atom), title: "Forum Topics")) %> diff --git a/app/views/forum_topics/show.html.erb b/app/views/forum_topics/show.html.erb index 71f98afcf..03b0bc11d 100644 --- a/app/views/forum_topics/show.html.erb +++ b/app/views/forum_topics/show.html.erb @@ -1,6 +1,9 @@ <% page_title @forum_topic.title %> <% meta_description(DText.excerpt(@forum_topic.original_post&.body)) %> +<% atom_feed_tag(@forum_topic.title, forum_topic_url(@forum_topic.id, format: :atom)) %> +<%= render "secondary_links" %> +

@@ -39,11 +42,7 @@

-<%= render "secondary_links" %> - <% content_for(:html_header) do %> - <%= auto_discovery_link_tag(:atom, {format: :atom}, {title: @forum_topic.title}) %> - <%= javascript_pack_tag "application" %> diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb index 890108423..1b418c425 100644 --- a/app/views/layouts/default.html.erb +++ b/app/views/layouts/default.html.erb @@ -11,7 +11,6 @@ <% if CurrentUser.user.blacklisted_tags.present? %> "> <% end %> - <%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %> <%= javascript_pack_tag "application" %> <%= stylesheet_pack_tag "application" %> diff --git a/app/views/posts/partials/index/_seo_meta_tags.html.erb b/app/views/posts/partials/index/_seo_meta_tags.html.erb index 3654e5701..05449e89d 100644 --- a/app/views/posts/partials/index/_seo_meta_tags.html.erb +++ b/app/views/posts/partials/index/_seo_meta_tags.html.erb @@ -1,9 +1,13 @@ <% if @post_set.is_empty_tag? %> <% page_title("#{Danbooru.config.app_name}: Anime Image Board", suffix: nil) %> <% meta_description("#{Danbooru.config.canonical_app_name} is the original anime image 'booru. Find over 3.75 million anime pictures categorized by over 100 million tags.") %> + + <% atom_feed_tag "Posts", posts_url(format: :atom) %> <% else %> <% page_title("#{@post_set.humanized_tag_string} Art") %> <% meta_description("See over #{number_with_delimiter(@post_set.post_count)} #{@post_set.humanized_tag_string} images on #{Danbooru.config.app_name}. #{DText.excerpt(@post_set.wiki_page&.body)}") %> + + <% atom_feed_tag "Posts: #{@post_set.tag_string}", posts_url(tags: @post_set.tag_string, format: :atom) %> <% end %> <%= tag.link href: posts_path(format: "atom", tags: params[:tags]), rel: "alternate", title: "ATOM", type: "application/atom+xml" %> diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb index f202fe205..e677b14f5 100644 --- a/app/views/posts/show.html.erb +++ b/app/views/posts/show.html.erb @@ -1,6 +1,7 @@ <% page_title @post.presenter.humanized_essential_tag_string %> <% meta_description "View this #{@post.image_width}x#{@post.image_height} #{number_to_human_size(@post.file_size)} image" %> +<% atom_feed_tag "Comments for post ##{@post.id}", comments_url(:atom, search: { post_id: @post.id }) %> <%= render "posts/partials/common/secondary_links" %> <% content_for(:sidebar) do %> @@ -187,6 +188,4 @@ <%= tag.meta name: "og:type", content: "website" %> <%= tag.meta name: "og:site", content: Danbooru.config.app_name %> - - <%= auto_discovery_link_tag(:atom, comments_url(:atom, search: { post_id: @post.id }), title: "Comments for post ##{@post.id}") %> <% end %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index b04b44221..00cbc3c4d 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -20,5 +20,5 @@ -<% content_for(:html_header, auto_discovery_link_tag(:atom, comments_url(:atom, search: { post_tags_match: "user:#{@user.name}" }), title: "Comments on #{@user.name}'s uploads")) %> -<% content_for(:html_header, auto_discovery_link_tag(:atom, comments_url(:atom, search: { post_tags_match: "commenter:#{@user.name}" }), title: "Comments on posts commented on by #{@user.name}")) %> +<% atom_feed_tag "Comments on #{@user.pretty_name}'s uploads", comments_url(:atom, search: { post_tags_match: "user:#{@user.name}" }) %> +<% atom_feed_tag "Comments on posts commented on by #{@user.pretty_name}", comments_url(:atom, search: { post_tags_match: "commenter:#{@user.name}" }) %>