From b2cc7e7016c842f7c0bb9bc6edd71aa7e6156fa1 Mon Sep 17 00:00:00 2001 From: songtianlun Date: Mon, 24 Feb 2025 14:12:51 +0800 Subject: [PATCH] chore: update keywords for SEO optimization - Refactor keywords in cities_controller.rb - Refactor keywords in weather_arts_controller.rb - Refactor keywords in application.html.erb This change improves the SEO of the application by updating keywords to include 'ai' and 'ai web', which are more relevant and likely to enhance search visibility. The previous keywords were less optimized for current trends in AI-related searches. --- app/controllers/cities_controller.rb | 2 +- app/controllers/weather_arts_controller.rb | 2 +- app/views/layouts/application.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/cities_controller.rb b/app/controllers/cities_controller.rb index b5ea272..a0883ff 100644 --- a/app/controllers/cities_controller.rb +++ b/app/controllers/cities_controller.rb @@ -46,7 +46,7 @@ class CitiesController < ApplicationController set_meta_tags( title: @city.name, description: "Experience #{@city.name}'s weather through AI-generated art. Daily updates of weather conditions visualized through artificial intelligence.", - keywords: "#{@city.name}, #{@city.country.name}, ai art, ai weather, weather art, AI visualization", + keywords: "#{@city.name}, #{@city.country.name}, ai, ai web, ai art, ai weather, weather art, AI visualization", og: { image: @city.latest_weather_art&.image&.attached? ? url_for(@city.latest_weather_art.image) : nil } diff --git a/app/controllers/weather_arts_controller.rb b/app/controllers/weather_arts_controller.rb index 05671a0..8ea6451 100644 --- a/app/controllers/weather_arts_controller.rb +++ b/app/controllers/weather_arts_controller.rb @@ -17,7 +17,7 @@ class WeatherArtsController < ApplicationController set_meta_tags( title: "#{@city.name} Weather Art - #{@weather_art.weather_date.strftime('%B %d, %Y')}", description: "#{@city.name}'s weather visualized through AI art. #{@weather_art.description} at #{@weather_art.temperature}°C.", - keywords: "#{@city.name}, #{@city.country.name}, ai art, ai weather, weather art, AI visualization, #{@weather_art.description}", + keywords: "#{@city.name}, #{@city.country.name}, ai, ai web, ai art, ai weather, weather art, AI visualization, #{@weather_art.description}", og: { image: @weather_art.image.attached? ? url_for(@weather_art.image) : nil } diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 7b8c1e5..b8df202 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -11,7 +11,7 @@ og: { site_name: 'TodayAIWeather', type: 'website', - keywords: "ai art, ai weather, weather art, AI visualization, today ai weather", + keywords: "ai, ai web, ai art, ai weather, weather art, AI visualization, today ai weather", url: request.original_url }, alternate: {