Skip to content

Commit a1a3ddb

Browse files
committed
Add canonical urls by default with meta tags
1 parent 93ab320 commit a1a3ddb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/helpers/application_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ def seo_meta_tags
2020
set_meta_tags twitter: {
2121
site: "@joyofrails"
2222
}
23+
set_meta_tags canonical: url_for(only_path: false, overwrite_params: nil) unless meta_tags[:canonical]
2324
display_meta_tags \
2425
site: Rails.configuration.x.application_name,
2526
description: "Interactive tutorials on Ruby, Ruby on Rails, Stimulus, " \

0 commit comments

Comments
 (0)