seo: add rel=nofollow to various internal search links.

Add rel=nofollow to various internal search links to prevent Google from
attempting to crawl things like `<tag> status:deleted` or `approver:<name>`
searches.
This commit is contained in:
evazion
2020-07-03 14:39:23 -05:00
parent 629a634b22
commit 99e88b3dae
8 changed files with 18 additions and 18 deletions

View File

@@ -56,15 +56,15 @@ class UserPresenter
end
def upload_count(template)
template.link_to(user.post_upload_count, template.posts_path(:tags => "user:#{user.name}"))
template.link_to(user.post_upload_count, template.posts_path(tags: "user:#{user.name}"), rel: "nofollow")
end
def deleted_upload_count(template)
template.link_to(user.posts.deleted.count, template.posts_path(:tags => "status:deleted user:#{user.name}"))
template.link_to(user.posts.deleted.count, template.posts_path(tags: "status:deleted user:#{user.name}"), rel: "nofollow")
end
def favorite_count(template)
template.link_to(user.favorite_count, template.posts_path(tags: "ordfav:#{user.name}"))
template.link_to(user.favorite_count, template.posts_path(tags: "ordfav:#{user.name}"), rel: "nofollow")
end
def favorite_group_count(template)
@@ -78,7 +78,7 @@ class UserPresenter
def commented_posts_count(template)
count = PostQueryBuilder.new("commenter:#{user.name}").fast_count
count = "?" if count.nil?
template.link_to(count, template.posts_path(:tags => "commenter:#{user.name} order:comment_bumped"))
template.link_to(count, template.posts_path(tags: "commenter:#{user.name} order:comment_bumped"), rel: "nofollow")
end
def post_version_count(template)
@@ -92,7 +92,7 @@ class UserPresenter
def noted_posts_count(template)
count = PostQueryBuilder.new("noteupdater:#{user.name}").fast_count
count = "?" if count.nil?
template.link_to(count, template.posts_path(:tags => "noteupdater:#{user.name} order:note"))
template.link_to(count, template.posts_path(tags: "noteupdater:#{user.name} order:note"), rel: "nofollow")
end
def wiki_page_version_count(template)
@@ -108,7 +108,7 @@ class UserPresenter
end
def forum_post_count(template)
template.link_to(user.forum_post_count, template.forum_posts_path(:search => {:creator_id => user.id}))
template.link_to(user.forum_post_count, template.forum_posts_path(search: { creator_id: user.id }), rel: "nofollow")
end
def pool_version_count(template)
@@ -128,7 +128,7 @@ class UserPresenter
end
def approval_count(template)
template.link_to(Post.where("approver_id = ?", user.id).count, template.posts_path(:tags => "approver:#{user.name}"))
template.link_to(Post.where(approver: user).count, template.posts_path(tags: "approver:#{user.name}"), rel: "nofollow")
end
def feedbacks(template)