From df32e0da7241068349bb951c99f589ee8e169066 Mon Sep 17 00:00:00 2001 From: evazion Date: Wed, 8 Jul 2020 14:59:35 -0500 Subject: [PATCH] seo: remove obsolete itemprop microdata attributes. Remove obsolete itemprop attributes. These were originally added in 2dd4b4c, but they haven't been working since e334c34 removed the itemscope and itemtype attributes. They never worked right because they weren't nested properly, and they were never really useful because Google doesn't use the ImageObject schema for anything. * https://developers.google.com/search/docs/guides/intro-structured-data * https://developer.mozilla.org/en-US/docs/Web/HTML/Microdata * https://schema.org/docs/gs.html * https://schema.org/ImageObject --- app/presenters/tag_set_presenter.rb | 3 +-- app/views/posts/partials/show/_image.html.erb | 2 +- app/views/posts/partials/show/_information.html.erb | 3 +-- app/views/uploads/show.html.erb | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/presenters/tag_set_presenter.rb b/app/presenters/tag_set_presenter.rb index 605f08020..6182b2073 100644 --- a/app/presenters/tag_set_presenter.rb +++ b/app/presenters/tag_set_presenter.rb @@ -125,8 +125,7 @@ class TagSetPresenter end humanized_tag = humanize_tags ? name.tr("_", " ") : name - itemprop = 'itemprop="author"' if tag.artist? - html << %{#{h(humanized_tag)} } + html << %{#{h(humanized_tag)} } unless name_only || tag.new_record? if count >= 10_000 diff --git a/app/views/posts/partials/show/_image.html.erb b/app/views/posts/partials/show/_image.html.erb index 194fbc7d0..be0189d1f 100644 --- a/app/views/posts/partials/show/_image.html.erb +++ b/app/views/posts/partials/show/_image.html.erb @@ -1,3 +1,3 @@ <% if policy(post).visible? %> - <%= image_tag(post.file_url_for(CurrentUser.user), width: post.image_width_for(CurrentUser.user), height: post.image_height_for(CurrentUser.user), id: "image", class: "fit-width", "data-original-width": post.image_width, "data-original-height": post.image_height, "data-large-width": post.large_image_width, "data-large-height": post.large_image_height, "data-tags": post.tag_string, alt: post.presenter.humanized_essential_tag_string, "data-uploader": post.uploader.name, "data-rating": post.rating, "data-flags": post.status_flags, "data-parent-id": post.parent_id, "data-has-children": post.has_children?, "data-has-active-children": post.has_active_children?, "data-score": post.score, "data-fav-count": post.fav_count, "itemprop": "contentUrl") %> + <%= image_tag(post.file_url_for(CurrentUser.user), width: post.image_width_for(CurrentUser.user), height: post.image_height_for(CurrentUser.user), id: "image", class: "fit-width", "data-original-width": post.image_width, "data-original-height": post.image_height, "data-large-width": post.large_image_width, "data-large-height": post.large_image_height, "data-tags": post.tag_string, alt: post.presenter.humanized_essential_tag_string, "data-uploader": post.uploader.name, "data-rating": post.rating, "data-flags": post.status_flags, "data-parent-id": post.parent_id, "data-has-children": post.has_children?, "data-has-active-children": post.has_active_children?, "data-score": post.score, "data-fav-count": post.fav_count) %> <% end %> diff --git a/app/views/posts/partials/show/_information.html.erb b/app/views/posts/partials/show/_information.html.erb index d96af09c4..0b57fa1b7 100644 --- a/app/views/posts/partials/show/_information.html.erb +++ b/app/views/posts/partials/show/_information.html.erb @@ -8,7 +8,6 @@ <% end %>
  • Date: <%= link_to time_ago_in_words_tagged(post.created_at), posts_path(tags: "date:#{post.created_at.to_date}") %> -
  • <% if post.approver %>
  • @@ -19,7 +18,7 @@
  • Size: <%= link_to_if policy(post).visible?, number_to_human_size(post.file_size), post.tagged_file_url %> <% if post.has_dimensions? %> - (<%= post.image_width %>x<%= post.image_height %>) + (<%= post.image_width %>x<%= post.image_height %>) <% end %>
  • Source: <%= post_source_tag(post.source, post.normalized_source) %>
  • diff --git a/app/views/uploads/show.html.erb b/app/views/uploads/show.html.erb index 38925b434..55057e47b 100644 --- a/app/views/uploads/show.html.erb +++ b/app/views/uploads/show.html.erb @@ -13,7 +13,7 @@
  • Size: <%= number_to_human_size(@upload.file_size) %>
  • <% if @upload.image_width.present? %> - (<%= @upload.image_width %>x<%= @upload.image_height %>) + (<%= @upload.image_width %>x<%= @upload.image_height %>) <% end %> <% end %>