feat: add default meta tags for SEO
- Implement default_meta_tags method in ApplicationHelper - Refactor application layout to utilize default_meta_tags This change improves SEO by centralizing the meta tags configuration. It ensures consistent metadata across the application while reducing repetition in the layout files.
This commit is contained in:
parent
41150ba78b
commit
a156cc04d1
@ -25,4 +25,27 @@ module ApplicationHelper
|
|||||||
def current_user_is_admin?
|
def current_user_is_admin?
|
||||||
current_user&.admin?
|
current_user&.admin?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def default_meta_tags
|
||||||
|
{
|
||||||
|
site: "TodayAIWeather",
|
||||||
|
title: "TodayAIWeather",
|
||||||
|
description: "Experience weather through artistic AI visualization. Daily updated weather art for cities worldwide.",
|
||||||
|
keywords: "AI weather art, weather visualization, city weather, artificial intelligence",
|
||||||
|
separator: "—".html_safe,
|
||||||
|
reverse: true,
|
||||||
|
og: {
|
||||||
|
site_name: "TodayAIWeather",
|
||||||
|
type: "website",
|
||||||
|
keywords: "ai, ai web, ai art, ai weather, weather art, AI visualization, today ai weather",
|
||||||
|
url: request.original_url
|
||||||
|
},
|
||||||
|
alternate: {
|
||||||
|
"en" => url_for(locale: "en"),
|
||||||
|
"zh-CN" => url_for(locale: "zh-CN"),
|
||||||
|
"ja" => url_for(locale: "ja"),
|
||||||
|
"ko" => url_for(locale: "ko")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -5,22 +5,7 @@
|
|||||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<%= display_meta_tags(
|
<%= display_meta_tags(default_meta_tags) %>
|
||||||
site: 'TodayAIWeather',
|
|
||||||
reverse: true,
|
|
||||||
og: {
|
|
||||||
site_name: 'TodayAIWeather',
|
|
||||||
type: 'website',
|
|
||||||
keywords: "ai, ai web, ai art, ai weather, weather art, AI visualization, today ai weather",
|
|
||||||
url: request.original_url
|
|
||||||
},
|
|
||||||
alternate: {
|
|
||||||
"en" => url_for(locale: 'en'),
|
|
||||||
"zh-CN" => url_for(locale: 'zh-CN'),
|
|
||||||
"ja" => url_for(locale: 'ja'),
|
|
||||||
"ko" => url_for(locale: 'ko')
|
|
||||||
}
|
|
||||||
) %>
|
|
||||||
<%= csrf_meta_tags %>
|
<%= csrf_meta_tags %>
|
||||||
<%= csp_meta_tag %>
|
<%= csp_meta_tag %>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user