From e8aa2b8d9a2765ea30521fa5e8a71481689f7480 Mon Sep 17 00:00:00 2001 From: Natalie Tay Date: Mon, 13 Jan 2025 13:50:00 +0800 Subject: [PATCH] DEV: Add a nofollow to /u so user profiles don't get added as a target for crawling (#30693) In some sites, we are noticing that /u routes are getting indexed. This commit adds a ["nofollow"](https://developers.google.com/search/docs/crawling-indexing/qualify-outbound-links) on user profiles so that Google will not index these user profile URLs. --- app/views/about/index.html.erb | 4 ++-- app/views/email/_post.html.erb | 4 ++-- app/views/embed/comments.html.erb | 4 ++-- app/views/list/list.erb | 2 +- app/views/topics/show.html.erb | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/about/index.html.erb b/app/views/about/index.html.erb index 98bfc49f279..e529aa5740a 100644 --- a/app/views/about/index.html.erb +++ b/app/views/about/index.html.erb @@ -15,7 +15,7 @@ <% @about.admins.each do |user| %>
- + @@ -36,7 +36,7 @@ <% @about.moderators.each do |user| %>
- + diff --git a/app/views/email/_post.html.erb b/app/views/email/_post.html.erb index 57507530d6c..6567549bb6c 100644 --- a/app/views/email/_post.html.erb +++ b/app/views/email/_post.html.erb @@ -6,12 +6,12 @@ <%- if SiteSetting.prioritize_username_in_ux %> - <%= post.user.username %> + <%= post.user.username %> <%- if show_name_on_post(post) %> <%= post.user.name %> <% end %> <%- else %> - <%= post.user.name %> + <%= post.user.name %> <%- if show_username_on_post(post) %> <%= post.user.username %> <% end %> diff --git a/app/views/embed/comments.html.erb b/app/views/embed/comments.html.erb index 66394aed573..ffe98eb97a3 100644 --- a/app/views/embed/comments.html.erb +++ b/app/views/embed/comments.html.erb @@ -16,11 +16,11 @@ <%- end %>
- +

- <%= post.user.username %> + <%= post.user.username %> <%- if post.user.title.present? %> <%= post.user.title %> <%- end %> diff --git a/app/views/list/list.erb b/app/views/list/list.erb index 21697dd1e65..bea29d36858 100644 --- a/app/views/list/list.erb +++ b/app/views/list/list.erb @@ -87,7 +87,7 @@ <% t.posters.each do |poster| %> - + <%- poster_name_and_description = h(poster.name_and_description) %> diff --git a/app/views/topics/show.html.erb b/app/views/topics/show.html.erb index ff894eefc9c..dd260e70057 100644 --- a/app/views/topics/show.html.erb +++ b/app/views/topics/show.html.erb @@ -55,7 +55,7 @@ <% if @topic_view.topic.user.present? %> <% end %> @@ -66,7 +66,7 @@
class='topic-body crawler-post'>