From a1a3ddb0c467803791407d3be39c6a6198f46b97 Mon Sep 17 00:00:00 2001 From: Ross Kaffenberger Date: Thu, 23 Jan 2025 09:35:32 -0500 Subject: [PATCH] Add canonical urls by default with meta tags --- app/helpers/application_helper.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a21959d8..992d87f3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -20,6 +20,7 @@ def seo_meta_tags set_meta_tags twitter: { site: "@joyofrails" } + set_meta_tags canonical: url_for(only_path: false, overwrite_params: nil) unless meta_tags[:canonical] display_meta_tags \ site: Rails.configuration.x.application_name, description: "Interactive tutorials on Ruby, Ruby on Rails, Stimulus, " \