diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index fe2727eb9c..1aa092289b 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -1,3 +1,5 @@ +- content_for :canonical_url, new_user_registration_url + #page-auth %section.form-section .inner diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 1979094e3f..4c2cc88287 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -1,3 +1,5 @@ +- content_for :canonical_url, new_user_session_url + #page-auth %section.form-section .inner diff --git a/app/views/journey/show.html.haml b/app/views/journey/show.html.haml index 9511d364ac..cbe327ace9 100644 --- a/app/views/journey/show.html.haml +++ b/app/views/journey/show.html.haml @@ -1,3 +1,5 @@ +- content_for :canonical_url, journey_url + #page-journey = render "journey/hero", user_tracks: @user_tracks = render ReactComponents::Journey::JourneyPage.new("overview", params) diff --git a/app/views/profiles/badges.html.haml b/app/views/profiles/badges.html.haml index 322c28594b..81eb3e1983 100644 --- a/app/views/profiles/badges.html.haml +++ b/app/views/profiles/badges.html.haml @@ -1,5 +1,6 @@ - content_for :meta_title, "#{sanitize(@user.handle)}'s badges to Exercism".html_safe - content_for :meta_description, "Explore #{sanitize(@user.handle)}'s badges on Exercism, and see which ones you're missing yourself".html_safe +- content_for :canonical_url, badges_profile_url(@user) #page-profile-badges = render ViewComponents::Profile::Header.new(@user, @profile, :badges) diff --git a/app/views/profiles/contributions.html.haml b/app/views/profiles/contributions.html.haml index de502dd1be..45eb43de29 100644 --- a/app/views/profiles/contributions.html.haml +++ b/app/views/profiles/contributions.html.haml @@ -1,5 +1,6 @@ - content_for :meta_title, "#{sanitize(@user.handle)}'s contributions to Exercism".html_safe - content_for :meta_description, "See how #{@user.handle} has contributed to Exercism" +- content_for :canonical_url, contributions_profile_url(@user, order: params[:order].presence, page: params[:page].to_i > 1 ? params[:page] : nil) #page-profile-contributions = render ViewComponents::Profile::Header.new(@user, @profile, :contributions) diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index 64b5d6c617..fad299b8e5 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -1,5 +1,6 @@ - content_for :meta_title, "#{sanitize(@user.handle)}'s profile on Exercism".html_safe - content_for :meta_description, "Explore what #{@user.handle} has done on Exercism - their solutions, contributions and testimonials." +- content_for :canonical_url, profile_url(@user) - if params[:first_time] = render ReactComponents::Profile::FirstTimeModal.new(@profile) diff --git a/app/views/profiles/solutions.html.haml b/app/views/profiles/solutions.html.haml index d86a673d1b..583df31e53 100644 --- a/app/views/profiles/solutions.html.haml +++ b/app/views/profiles/solutions.html.haml @@ -1,5 +1,6 @@ - content_for :meta_title, "#{sanitize(@user.handle)}'s solutions Exercism".html_safe - content_for :meta_description, "Explore #{sanitize(@user.handle)}'s solutions on Exercism, and see everything they've learnt.".html_safe +- content_for :canonical_url, solutions_profile_url(@user, order: params[:order].presence, page: params[:page].to_i > 1 ? params[:page] : nil) #page-profile-solutions = render ViewComponents::Profile::Header.new(@user, @profile, :solutions) diff --git a/app/views/profiles/testimonials.html.haml b/app/views/profiles/testimonials.html.haml index fe74130759..8a7f376fa1 100644 --- a/app/views/profiles/testimonials.html.haml +++ b/app/views/profiles/testimonials.html.haml @@ -1,5 +1,6 @@ - content_for :meta_title, "#{sanitize(@user.handle)}'s testimonials on Exercism".html_safe - content_for :meta_description, "Explore the testimonails that students have left for #{@user.handle} on Exercism, and learn how wonderful they are!" +- content_for :canonical_url, testimonials_profile_url(@user, page: params[:page].to_i > 1 ? params[:page] : nil) #page-profile-testimonials = render ViewComponents::Profile::Header.new(@user, @profile, :testimonials) diff --git a/app/views/tracks/community_solutions/index.html.haml b/app/views/tracks/community_solutions/index.html.haml index 39a4468fbe..c018c632de 100644 --- a/app/views/tracks/community_solutions/index.html.haml +++ b/app/views/tracks/community_solutions/index.html.haml @@ -1,6 +1,6 @@ - content_for :meta_title, "Community solutions for #{@exercise.title} in #{@track.title} on Exercism" - content_for :meta_description, "Explore other people's solutions to #{@exercise.title} in #{@track.title}, and learn how others have solved the exercise.".html_safe -- content_for :canonical_url, track_exercise_solutions_url(@track, @exercise) +- content_for :canonical_url, track_exercise_solutions_url(@track, @exercise, order: params[:order].presence, page: params[:page].to_i > 1 ? params[:page] : nil) #page-community-solutions-index = render ViewComponents::Track::ExerciseHeader.new(@exercise, @solution, @user_track, :community_solutions) diff --git a/app/views/tracks/concepts/index.html.haml b/app/views/tracks/concepts/index.html.haml index 445952f7e9..56a84f4f07 100644 --- a/app/views/tracks/concepts/index.html.haml +++ b/app/views/tracks/concepts/index.html.haml @@ -1,5 +1,6 @@ - content_for :meta_title, "#{@track.title} key concepts on Exercism" - content_for :meta_description, "Learn and master #{@user_track.num_concepts} key concepts in #{@track.title} on Exercism." +- content_for :canonical_url, track_concepts_url(@track) #page-concepts-index = render ViewComponents::Track::Header.new(@track, :concepts)