seo: fix canonical tags on post index and show page.
* Fix incorrect canonical tags. Before we were using `<meta name="canonical" content="...">`. This is wrong, it should have been `<link rel="canonical" href="...">`. * Add a default canonical tag on all pages. Fixes Google treating the same content on different subdomains (safebooru, shima, kagamihara, etc) as duplicate content. Also fixes Google sometimes treating similar but distinct content on the same domain as duplicate content.
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
<% 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" %>
|
||||
|
||||
<% canonical_url post_url(@post, host: Danbooru.config.hostname) %>
|
||||
<% 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 %>
|
||||
@@ -148,8 +149,6 @@
|
||||
<%= tag.meta property: "og:image", content: @post.open_graph_image_url %>
|
||||
<% end %>
|
||||
|
||||
<%= tag.meta name: "canonical", content: post_url(@post, host: Danbooru.config.hostname, protocol: "https") %>
|
||||
|
||||
<% if @post.twitter_card_supported? %>
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user