From 141f16eb6b6f3f35a10dc1133e66507dd5931fb0 Mon Sep 17 00:00:00 2001 From: Dan Ungureanu Date: Mon, 11 May 2020 20:37:50 +0300 Subject: [PATCH] FIX: Multiple schema.org improvements * Do not show "Uncategorized" category in topics list. * Use "BreadcrumbList" only if topic is in a category. * Add tags list as keywords to the first post. * Add "dateModified" even if it is the same with "datePublished". * Show "crawler-linkback-list" only if there are links to be shown. --- .../common/base/crawler_layout.scss | 4 ++ app/views/list/list.erb | 2 +- app/views/topics/show.html.erb | 37 ++++++++++++------- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/app/assets/stylesheets/common/base/crawler_layout.scss b/app/assets/stylesheets/common/base/crawler_layout.scss index b0588f35b58..c279aceff4c 100644 --- a/app/assets/stylesheets/common/base/crawler_layout.scss +++ b/app/assets/stylesheets/common/base/crawler_layout.scss @@ -33,6 +33,10 @@ body.crawler { margin-top: 4em; } + .topic-category { + display: inline; + } + .discourse-tags { color: $primary-medium; } diff --git a/app/views/list/list.erb b/app/views/list/list.erb index 579022caee2..2d32efb77bf 100644 --- a/app/views/list/list.erb +++ b/app/views/list/list.erb @@ -67,7 +67,7 @@ <%= t.title %> @@ -32,7 +35,7 @@ <%- if include_crawler_content? %> - <% @topic_view.posts.each do |post| %> + <% @topic_view.posts.each_with_index do |post, idx| %>
<% if (u = post.user) %> + <% if idx == 0 %> + '> + <% end %>
@@ -79,7 +90,7 @@
- <% if @topic_view.link_counts[post.id] && @topic_view.link_counts[post.id].length > 0 %> + <% if @topic_view.link_counts[post.id] && @topic_view.link_counts[post.id].filter { |l| l[:reflection] }.length > 0 %>
<% @topic_view.link_counts[post.id].each_with_index do |link, i| %> <% if link[:reflection] && link[:title].present? %>