Skip to content

Commit

Permalink
Add more canonical URLs (#6136)
Browse files Browse the repository at this point in the history
* Add pages to canonical URLs

* Add some missing canonical URLs

* Add profile canonical URLs
  • Loading branch information
iHiD authored Sep 11, 2023
1 parent c61936a commit a18cb88
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/views/devise/registrations/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- content_for :canonical_url, new_user_registration_url

#page-auth
%section.form-section
.inner
Expand Down
2 changes: 2 additions & 0 deletions app/views/devise/sessions/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- content_for :canonical_url, new_user_session_url

#page-auth
%section.form-section
.inner
Expand Down
2 changes: 2 additions & 0 deletions app/views/journey/show.html.haml
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions app/views/profiles/badges.html.haml
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions app/views/profiles/contributions.html.haml
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions app/views/profiles/show.html.haml
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions app/views/profiles/solutions.html.haml
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions app/views/profiles/testimonials.html.haml
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion app/views/tracks/community_solutions/index.html.haml
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions app/views/tracks/concepts/index.html.haml
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit a18cb88

Please sign in to comment.