seo: mark login links as nofollow.

Mark links to the login page as rel="nofollow" so that search crawlers
don't constantly try to crawl it. Otherwise the fact the login url is
different on every page (/login?url=<current_url>) confuses crawlers.

Also strip the url param from the canonical url (<link rel="canonical">)
on the login page.
This commit is contained in:
evazion
2020-12-27 04:41:49 -06:00
parent 57e70e5b82
commit ddd149e22b
2 changed files with 2 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
<menu id="main-menu" class="main">
<% if CurrentUser.is_anonymous? %>
<%= nav_link_to("Login", login_path(url: request.fullpath)) %>
<%= nav_link_to("Login", login_path(url: request.fullpath), rel: "nofollow") %>
<% else %>
<%= nav_link_to("My Account #{unread_dmail_indicator(CurrentUser.user)}", profile_path) %>
<% end %>

View File

@@ -1,5 +1,6 @@
<% page_title "Login" %>
<% meta_description "Login to #{Danbooru.config.app_name}" %>
<% canonical_url login_url %>
<%= render "sessions/secondary_links" %>