From 31a2ec373df100f2c67beba5d7732ece48ca864a Mon Sep 17 00:00:00 2001 From: songtianlun Date: Mon, 17 Feb 2025 00:27:44 +0800 Subject: [PATCH] refactor: Update sitemap configuration to support a new host name - Modified the host name in the sitemap configuration to support the new domain. - This commit changes the hostname, and updates the sitemap to reflect the correct host. - This is done to reflect the correct host on the production server. - Added the new `public/sitemaps` directory to .gitignore to avoid commits related to this directory, and updates the .gitignore. --- .gitignore | 1 + config/sitemap.rb | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index bdebf4a..73c02f0 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ .idea public/sitemap.xml.gz +public/sitemaps diff --git a/config/sitemap.rb b/config/sitemap.rb index d053ca6..f276be4 100644 --- a/config/sitemap.rb +++ b/config/sitemap.rb @@ -1,5 +1,7 @@ # Set the host name for URL creation -host = Rails.env.production? ? "https://todayaiweather.com" : "http://127.0.0.1:3000" +# host = Rails.env.production? ? "https://todayaiweather.com" : "http://127.0.0.1:3000" +host = Rails.env.production? ? "https://pub.r2.todayaiweather.com" : "http://127.0.0.1:3000" +# host = "https://pub.r2.todayaiweather.com" Rails.application.routes.default_url_options[:host] = host SitemapGenerator::Sitemap.adapter = SitemapGenerator::AwsSdkAdapter.new( Rails.application.credentials.dig(:aws, :bucket),