seo: prevent crawlers from crawling /posts/:id/favorites.

This commit is contained in:
evazion
2021-12-09 23:47:52 -06:00
parent 4021ddb579
commit bf022e858a
5 changed files with 7 additions and 2 deletions

View File

@@ -8,7 +8,7 @@
<% end %> <% end %>
<span class="post-score"> <span class="post-score">
<%= link_to post.score, post_votes_path(search: { post_id: post.id }, variant: :compact) %> <%= link_to post.score, post_votes_path(search: { post_id: post.id }, variant: :compact), rel: "nofollow" %>
</span> </span>
<% if current_user.is_anonymous? %> <% if current_user.is_anonymous? %>

View File

@@ -1,3 +1,5 @@
<% noindex %>
<div id="c-favorites"> <div id="c-favorites">
<div id="a-index"> <div id="a-index">
<% if @post %> <% if @post %>

View File

@@ -1,3 +1,5 @@
<% noindex %>
<div id="c-post-votes"> <div id="c-post-votes">
<div id="a-index"> <div id="a-index">
<%= render "search" %> <%= render "search" %>

View File

@@ -26,7 +26,7 @@
<li id="post-info-favorites"> <li id="post-info-favorites">
Favorites: Favorites:
<%= tag.span class: "post-favcount", "data-id": post.id do %> <%= tag.span class: "post-favcount", "data-id": post.id do %>
<%= link_to post.fav_count, post_favorites_path(post) %> <%= link_to post.fav_count, post_favorites_path(post), rel: "nofollow" %>
<% end %> <% end %>
</li> </li>
<li id="post-info-status"> <li id="post-info-status">

View File

@@ -8,6 +8,7 @@ Disallow: /*.json
Disallow: /posts?tags=source:* Disallow: /posts?tags=source:*
Disallow: /posts?tags=ordfav:* Disallow: /posts?tags=ordfav:*
Disallow: /posts?tags=approver:* Disallow: /posts?tags=approver:*
Disallow: /posts/*/favorites
Disallow: <%= artist_urls_path %> Disallow: <%= artist_urls_path %>
Disallow: <%= artist_versions_path %> Disallow: <%= artist_versions_path %>