fix: update city title for improved SEO

- Change title format to include city and country names
- Comment out default title setting to avoid fallback

This update enhances the title tag used in the meta data of
city pages, providing better search engine optimization by
including both the city name and its country. The change
also comments out the default title with a fallback to avoid
showing an incorrect title when the city details are not
available.
This commit is contained in:
songtianlun 2025-04-08 16:33:10 +08:00
parent 3e61ecaae5
commit 41150ba78b
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ class CitiesController < ApplicationController
}
set_meta_tags(
title: @city.name,
title: "#{@city.name}, #{@city&.country&.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, ai web, ai art, ai weather, weather art, AI visualization",
og: {

View File

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="<%= I18n.locale %>">
<head>
<title><%= content_for(:title) || "Today Ai Weather" %></title>
<!--<title><%#= content_for(:title) || "Today Ai Weather" %></title>-->
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">