songtianlun
a0516f731c
- Introduced `SeoConcern` module to handle SEO meta tags - Integrated `meta-tags` gem for customizable meta tags - Created `RefreshSitemapWorker` to automate sitemap updates - Added relevant meta tags in controllers for weather art and cities - Configured sitemap generation settings These changes improve the SEO of the application by ensuring that pages have appropriate meta tags. Additionally, a sitemap is now generated and refreshed daily, enhancing site visibility to search engines.
24 lines
624 B
Ruby
24 lines
624 B
Ruby
# app/concerns/seo_concern.rb
|
|
module SeoConcern
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
before_action :prepare_meta_tags
|
|
end
|
|
|
|
private
|
|
|
|
def prepare_meta_tags
|
|
set_meta_tags(
|
|
site: "TodayAIWeather",
|
|
description: "Discover AI-generated weather art from cities around the world. Real-time weather visualization through artificial intelligence.",
|
|
keywords: "weather, AI art, weather visualization, city weather, artificial intelligence",
|
|
og: {
|
|
title: :title,
|
|
description: :description,
|
|
type: "website",
|
|
url: request.original_url,
|
|
}
|
|
)
|
|
end
|
|
end |