From ea80d51ecfd72339dcf7762fa9e3ea5564a3b8b8 Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 24 May 2017 15:51:25 -0500 Subject: [PATCH 1/2] /posts/$id: add feed discovery link for comments on post. --- app/views/comments/index.atom.builder | 1 + app/views/posts/show.html.erb | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/views/comments/index.atom.builder b/app/views/comments/index.atom.builder index 0c0396626..e5458fac7 100644 --- a/app/views/comments/index.atom.builder +++ b/app/views/comments/index.atom.builder @@ -2,6 +2,7 @@ atom_feed 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)) diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb index 4ed71de3c..6cb62c631 100644 --- a/app/views/posts/show.html.erb +++ b/app/views/posts/show.html.erb @@ -175,6 +175,8 @@ <% end %> + + <%= auto_discovery_link_tag(:atom, comments_url(:atom, search: { post_id: @post.id }), title: "Comments for post ##{@post.id}") %> <% end %> <%= render "posts/partials/common/secondary_links" %> From 1b03832b26c2bfb8fa2a2096defe206e850ce5a7 Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 24 May 2017 16:09:32 -0500 Subject: [PATCH 2/2] /forum_topics/$id: fix atom feed discovery link. > Found an issue with the forum topic ATOM discovery link. Currently the > link is visible to feed detectors, but they are unable to add it since > the link provided is invalid. > > --- app/views/forum_topics/show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/forum_topics/show.html.erb b/app/views/forum_topics/show.html.erb index 2f74bfefd..fae19d00b 100644 --- a/app/views/forum_topics/show.html.erb +++ b/app/views/forum_topics/show.html.erb @@ -43,6 +43,8 @@ <% end %> <%= content_for(:html_header) do %> + <%= auto_discovery_link_tag(:atom, {format: :atom}, {title: @forum_topic.title}) %> + <% end %> - -<% content_for(:html_header, auto_discovery_link_tag(:atom, forum_topics_url(@forum_topic, :atom), title: @forum_topic.title)) %>