Commit Graph

414 Commits

Author SHA1 Message Date
0bca23ff77 fix: correct state name presence check
Some checks failed
Docker Dev / docker (push) Has been cancelled
CI / scan_ruby (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
Docker Main / docker (push) Has been cancelled
- Update condition to check for state presence instead of name
- Ensure proper rendering of state badge in city and weather art views

This change improves the logic for displaying the state badge by
checking for the presence of the state object directly, which
prevents potential errors when the state name is not set. It
ensures that the badge is displayed correctly when a state is
associated with a city or weather art.
2025-04-26 00:29:33 +08:00
639c36200b refactor: improve conditional rendering in views
- Replace 'else' with 'elsif' for better clarity
- Ensure badges are displayed only when country and state are present

These changes enhance the readability of the code and ensure that
only relevant information is displayed in the UI, improving the
user experience.
2025-04-26 00:23:03 +08:00
5b7f0bba4f feat: enhance city and weather art views with links
- Update country and state badges to be links when region is present
- Maintain fallback display for badges when region is not available
- Improve user navigation by linking to relevant city pages

These changes enhance the user experience by allowing users to
click on country and state badges to view related cities. The
previous static display has been improved to provide more
contextual navigation options, making the application more
interactive and user-friendly.
2025-04-26 00:14:34 +08:00
2a4faca6c8 style: remove commented-out title line
- Removed the commented-out title line from the application layout.

This change improves code readability by eliminating unnecessary comments.
It does not affect the rendering or functionality of the application.
2025-04-25 17:06:23 +08:00
07afbda252 feat: add default canonical URL handling
Some checks failed
Docker Dev / docker (push) Has been cancelled
CI / scan_ruby (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
Docker Main / docker (push) Has been cancelled
- Introduce a new before_action to set the default canonical URL
- Implement set_canonical_url method to manage canonical URLs
- Update application helper to use the canonical URL for meta tags

This change enhances SEO by ensuring that the canonical URL is set
correctly for each page, preventing duplicate content issues. The
canonical URL is derived from the original request URL, excluding
query parameters.
2025-04-23 20:45:49 +08:00
81c1d33036 fix: update generation interval for weather arts
Some checks failed
Docker Dev / docker (push) Has been cancelled
CI / scan_ruby (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
Docker Main / docker (push) Has been cancelled
- Change generation interval from 36 hours to 365 days
- Commented out the old interval for reference

This update significantly extends the generation interval for
weather arts, ensuring that the batch generation process is
more efficient and less frequent. The old interval has been
kept as a comment to provide context for future references.
2025-04-15 16:23:01 +08:00
cb8e5dd57d refactor: simplify localized_name method
Some checks failed
Docker Dev / docker (push) Has been cancelled
CI / scan_ruby (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
Docker Main / docker (push) Has been cancelled
- Remove I18n translation from localized_name
- Return city name directly instead

This change simplifies the method's implementation by returning
the city name directly, avoiding the overhead of translation.
Additionally, it improves code clarity by reducing complexity.
2025-04-12 16:54:00 +08:00
6dce657126 fix: correct logger reference in city description worker
- Fix the logging reference to use the instance variable
  @city instead of the local variable city.

This change ensures that the correct city name is logged
upon successfully generating the city description, which
improves the clarity and accuracy of the log messages.
2025-04-12 15:40:53 +08:00
43ae514242 refactor: update weather art descriptions
- Change description to use @weather_art.prompt instead of
  a translated string with multiple parameters.
- Update image_alt method to include the prompt in the
  descriptive text.

These changes simplify the metadata generation for weather art and
improve the clarity of the image descriptions by incorporating the
prompt, which may provide users with additional context.
2025-04-12 15:28:47 +08:00
7bdf40e176 feat: update city weather descriptions in locales
- Modify weather description format in multiple language locale files
- Use full city name in place of just city name in descriptions
- Ensure consistency across all language files for better user experience

These changes standardize the way city weather is presented across
various languages by including more detailed descriptions, thus enhancing
clarity and providing additional context for users.
2025-04-12 15:13:21 +08:00
6f01174ea9 feat: enhance city description generation
- Modify get_description method to include an additional
  parameter for user context
- Update usage in views to reflect the new parameter
- Adjust temporary description message based on user context

This change enhances the city description generation logic by
allowing differentiation in how the description is provided
depending on whether the calling context is a user. It improves
the user experience while ensuring that non-user contexts
handle descriptions differently. This minor enhancement also
included updating the view to support this new logic.
2025-04-12 14:46:44 +08:00
e33209ccdd feat: enhance city description generation
- Add 'quick' parameter to get_description method to enable
  asynchronous generation requests.
- Implement AI description generation in the background using
  GenerateCityDescriptionWorker.
- Create a shared partial for displaying city descriptions in
  the show views for both cities and weather arts.
- Update existing methods to support generated descriptions and
  new asynchronous behavior.
2025-04-12 14:31:09 +08:00
b0b64c2fe3 feat: add AI-generated city descriptions
- Implement method to get multilingual city descriptions
- Create worker for generating descriptions in the background
- Update database schema to include description translations
- Update AiService to fetch descriptions from City model

This commit introduces a feature to generate city descriptions
in multiple languages using AI. It includes methods for
caching descriptions and a background job to handle
generation to improve performance and user experience.
2025-04-12 14:03:48 +08:00
371b534c48 fix: correct alt attribute for image tag
Some checks failed
Docker Dev / docker (push) Has been cancelled
CI / scan_ruby (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
Docker Main / docker (push) Has been cancelled
- Update alt attribute to reference the first item's image_alt
- This change improves accessibility by ensuring the correct
  descriptive text is used if the latest_arts is present.

Prior to this change, there was a risk of displaying an incorrect
description if the latest_arts was empty, which could lead to
confusion for users relying on alt text for context.
2025-04-10 22:47:33 +08:00
4236e1a81d feat: add image alt text generation
- Introduced `image_alt` method in the WeatherArt model
- Updated image tags in views to use the new method for alt text
- Ensured consistent and descriptive alt text for better accessibility

This change improves the overall usability for screen readers and helps maintain a standard format for alt descriptions across various components in the application.
2025-04-10 22:37:27 +08:00
0cfb3e8e5c feat: add alt text to weather art images
- Introduced alt text for featured weather art images
- Added descriptive alt attribute to improve accessibility
- Enhanced SEO and user experience for image content

This change improves the accessibility of weather art images
by providing descriptive alt text. This helps visually impaired
users and enhances the website's SEO performance.
2025-04-10 17:41:24 +08:00
69415b8ba1 feat: add Turbo0 listing badge to home page
- Include a link to the Turbo0 webpage
- Add an image badge indicating the listing

This change enhances the visibility of the listing
for the application on Turbo0, promoting user
engagement and providing proof of the application's
presence on external platforms.
2025-04-10 16:51:20 +08:00
7f856c2975 style: update layout margins in home index view
- Change the top margin to mt-12 and bottom margin to mb-12
- Adjust the container class for a more balanced spacing

These changes enhance the visual appearance of the home page by
providing a consistent layout, improving overall user experience.
2025-04-10 15:38:29 +08:00
b38d2fe65b feat: enhance home page layout and add sponsorship badges
- Restructure home page layout for better visual appeal
- Add links to sponsorship badges for ImgLab and Product Hunt
- Ensure buttons are styled consistently with updated classes

These changes improve the user experience by providing a more attractive and informative layout. The addition of sponsorship badges also helps in promoting partnerships.
2025-04-10 15:09:51 +08:00
ab50ed3036 feat: add support for multiple image generation models
- Introduced constant MODELS for managing model names.
- Updated the `generate_image` method to switch between FLUX and DALL-E 3.
- Added `generate_image_dalle` and `generate_image_flux` methods for respective API calls.
- Enhanced prompts for image generation across both models, ensuring correct message construction.

This update enables users to generate images using different AI models dynamically, allowing for flexible integration and improved user experience. The handling of errors now falls back to the DALL-E model if the FLUX API fails.
2025-04-10 12:00:57 +08:00
719a523cc9 refactor: comment out startup task scheduling code
- Commented out the block that schedules the RefreshSitemapWorker
- This change was made to temporarily disable the startup task
- Maintains existing code structure without loss of functionality
2025-04-09 16:14:22 +08:00
4d38dad1cf feat: improve DALL-E prompt generation for weather scenes
- Update the prompt to specify generating a highly detailed and
  photorealistic image for a specific weather moment.
- Enhance clarity regarding the scene's inspiration by retaining
  context about the city, state, country, and region.

This change refines the AI generation process by focusing on
particular weather moments, improving the output's relevance and
detail, which could lead to a better user experience.
2025-04-09 15:51:56 +08:00
3f8a5d925e feat: refine DALL-E prompt structure for weather scenes
- Update prompt structure to enhance clarity and detail.
- Include specific requirements for realism and aesthetics in the images.
- Emphasize photorealistic elements, lighting, and composition rules.

These changes enable the AI to produce more accurate and visually appealing images based on weather conditions and city characteristics. It improves the instructions given to DALL-E, ensuring detailed and realistic output.
2025-04-09 15:47:59 +08:00
d8f1fd278c feat: add multilingual metadata for TodayAIWeather
- Introduced site name and descriptions in Arabic, Bengali, German, Spanish,
  French, Hindi, Croatian, Italian, Japanese, Korean, Polish, Portuguese,
  Russian, Turkish, Ukrainian, Urdu, and Chinese.
- Added keywords for better SEO and user discoverability.

This update improves the website experience for non-English speaking
users and reflects our commitment to accessibility and inclusivity.
All language files now contain appropriate semantic content for
social media previews and search engines.
2025-04-08 17:15:57 +08:00
dcf762726c feat: add meta tags for SEO optimization
- Implement meta tags in ArtsController, CitiesController, HomeController, and WeatherArtsController for better SEO.
- Use translation helpers for titles, descriptions, and keywords to improve internationalization support.
- Update default meta tags in ApplicationHelper for consistent site-wide SEO.

These changes enhance the search engine visibility of the application by providing relevant meta information across various pages. Utilizing translation for these fields promotes better support for multiple languages, aligning with localization efforts.
2025-04-08 17:04:32 +08:00
a156cc04d1 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.
2025-04-08 16:48:22 +08:00
41150ba78b 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.
2025-04-08 16:33:10 +08:00
3e61ecaae5 refactor: update URL generation for weather arts
- Change URL path from '/weather_arts/' to '/weather/' to better reflect
  the content type.
- Enhance code readability by making URL structure more intuitive.

This change improves the clarity of the URLs generated for
weather art and aligns better with the overall naming conventions.
2025-04-08 15:51:24 +08:00
1624382e37 fix: correct URL structure for weather arts
- Update the URL generation logic to reflect the new
  route format.
- Ensure that the URLs for different locales now point
to the correct weather arts resource.

This change fixes an issue where URLs could lead to
incorrect endpoints, improving the functionality of
image attachment processing.
2025-04-08 15:37:26 +08:00
0ff9ad4ff9 fix: update URL slugs for cities and weather arts
- Changed URLs to use city slugs instead of IDs
- Updated corresponding URLs for weather arts to use slugs

This change ensures that the URLs are more readable and maintainable
by using slugs rather than numerical IDs. It improves SEO and
user experience when accessing city and weather art pages.
2025-04-08 15:24:29 +08:00
808061c4f3 chore: update sidekiq scheduler description
- Change description for the submit_indexnow job from
  "Refresh sitemap daily" to "Submit Indexnow daily".
- Description modification improves clarity on job function.
- This adjustment does not affect job scheduling or operations.
2025-04-08 15:15:33 +08:00
5c3acbb197 chore: update indexnow key and remove old file
- Update INDEXNOW_KEY value to a new key.
- Remove the old key file (339ecd3e9cf648c29b767f5673329e48.txt).
- Create a new key file (79701a0df5814ed387163513269fd4dd.txt).

This change is necessary due to the rotation of the indexing key. The
old key is no longer valid, and the update ensures continued
functionality with IndexNow services. All references to the old
key have been removed to avoid confusion and ensure that the
new key is correctly used in the worker.
2025-04-08 15:08:06 +08:00
a53e6bdf54 refactor: remove key verification controller and update routes
- Deleted KeyVerificationController to simplify the application
- Adjusted order of endpoints in SubmitToIndexnowWorker
- Removed key verification route that was previously handled by the controller
- Added new static text file for key verification instead

This change streamlines the key verification process by removing unnecessary code and implementing a simpler method using a text file.
2025-04-08 14:42:56 +08:00
67e15e1fee feat: enhance submit_urls method to include host
- Updated submit_urls method to accept a host parameter.
- Modified the submit_urls call in each_slice to pass the host.
- Added keyLocation to the data hash using the host.

This change allows for more flexible URL submissions with hosts
specific to the IndexNow API requirements. The host is now a
parameter, improving the configurability of the submit process.
2025-04-08 14:29:13 +08:00
f6cf64e5b8 feat: add scheduled task for IndexNow submissions
- Make the `perform` method accept an optional parameter for recent updates
- Log the number of URLs submitted to IndexNow
- Introduce a new scheduled job for submitting URLs to IndexNow daily

This commit enhances the functionality of the `SubmitToIndexnowWorker` by allowing
it to be triggered via a scheduled job. It also adds logging for better monitoring
of submissions, improving traceability and performance in sitemap management.
2025-04-08 14:21:54 +08:00
e8aa6fc388 fix: update URL collection to filter by recently updated
- Modify the collect_urls method to accept a recently_updated
  parameter for filtering.
- Update the queries for City and WeatherArt models
  to only include records updated after the specified time.
- This change improves the efficiency of URL collection by
  ensuring that outdated entries are not submitted, thus
  aligning with IndexNow requirements.
2025-04-08 14:18:48 +08:00
5852d8724e feat: add key verification and IndexNow submission worker
- Implement KeyVerificationController to handle ID-based key verification.
- Create SubmitToIndexnowWorker for background processing of URL submissions.
- Add routes for key verification and extend functionality of URL submissions to IndexNow.

This commit enhances the application by allowing for verification of API keys and automatic submission of URLs to multiple endpoints, improving SEO and resource accessibility.
2025-04-08 14:04:16 +08:00
11d7adba99 chore: comment out unused popular arts section
- Comment out the popular weather art rendering and related titles in
  the home index view.
- Keep the latest weather art section active for display.

This change removes sections of code related to popular and random
weather art, which are not currently in use, while preserving a
clean interface for the latest weather art.
2025-04-08 11:14:00 +08:00
6e07435474 chore: remove unused analytics scripts
- Deleted LA_COLLECT script and initialization code
- Removed any references to unused analytics resources

These changes clean up the application layout by removing
scripts that were no longer in use, potentially improving
load times and reducing unnecessary code complexity.
2025-04-08 11:10:29 +08:00
d79e205c54 chore: update brakeman to version 7.0.2
- Update brakeman gem from version 7.0.0 to 7.0.2
- This update includes security fixes and performance improvements.

Keeping gems up to date helps maintain security and improves overall
performance of the application.
2025-04-07 17:36:39 +08:00
0dc47e4a92 feat: add LA data collection script
- Include SDK script for user activity collection
- Initialize SDK with specific IDs

This change integrates a data collection tool into the
application, allowing for improved tracking of user
interactions. The SDK will help gather actionable insights
for enhancing user experience.
2025-04-07 17:31:36 +08:00
435244777c style: simplify wiki data badge display
Some checks failed
Docker Dev / docker (push) Has been cancelled
CI / scan_ruby (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
Docker Main / docker (push) Has been cancelled
- Removed unnecessary div wrappers from the wiki data badge
- Cleaned up the code for better readability

This change enhances the markup simplicity without affecting the functionality,
ensuring the badge displays correctly while maintaining the same styling.
2025-04-02 15:37:51 +08:00
75e7004da6 style: update badge styling for wiki data display
- Change badge class from 'badge-ghost' to 'badge-info'
- Adjust the badge to have a softer appearance

This update improves the visual clarity of the wiki data badge, making it
more consistent with the overall design while ensuring the functionality
remains unchanged.
2025-04-02 15:27:52 +08:00
ddc10e9679 style: update wiki data badge layout
- Wrap badge content in a div for better layout.
- Maintain existing functionality and styling while improving structure.

This change enhances the HTML structure of the wiki data badge by
encapsulating the link in a div element, which aids in layout
management without altering the way the component functions or
displays.
2025-04-02 15:25:46 +08:00
025ee0d06a fix: correct rendering syntax for wiki data badge
- Updated rendering syntax in 'show' view for cities
- Updated rendering syntax in 'show' view for weather arts

These changes ensure that the 'wiki_data_badge' partial is rendered
correctly in both views, improving the consistency of the code
and fixing potential display issues caused by the previous syntax.
2025-04-02 15:06:02 +08:00
1cc1af0ff2 feat: extract wiki data badge into a shared partial
- Replace inline wiki data badge code with a render call to a new
  shared partial.
- This change promotes code reuse and simplifies the view
  templates for cities and weather arts.
- The shared partial handles the condition for displaying the badge
  based on the presence of `wiki_data_id`.

This refactor enhances maintainability and adheres to DRY
principles, allowing for easier updates or changes to the wiki
badge display in one location instead of multiple views.
2025-04-02 14:54:49 +08:00
3bfc64b0c8 feat: add translations for wiki data in locales
- Add translation for 'wiki_data' in Arabic
- Add translation for 'wiki_data' in Bengali
- Add translation for 'wiki_data' in German
- Add translation for 'wiki_data' in English
- Add translation for 'wiki_data' in Spanish
- Add translation for 'wiki_data' in Persian
- Add translation for 'wiki_data' in French
- Add translation for 'wiki_data' in Hindi
- Add translation for 'wiki_data' in Croatian
- Add translation for 'wiki_data' in Italian
- Add translation for 'wiki_data' in Japanese
- Add translation for 'wiki_data' in Korean
- Add translation for 'wiki_data' in Polish
- Add translation for 'wiki_data' in Portuguese
- Add translation for 'wiki_data' in Russian
- Add translation for 'wiki_data' in Turkish
- Add translation for 'wiki_data' in Ukrainian
- Add translation for 'wiki_data' in Urdu
- Add translation for 'wiki_data' in Chinese (Simplified)

This update provides localized support for the term 'wiki_data' across multiple languages, improving user experience and accessibility in international environments.
2025-04-02 14:43:03 +08:00
73c73a2a9e feat: add WikiData link to city details
- Include a link to the city's WikiData page if available
- The link opens in a new tab and has a tooltip for better user experience

This change enhances the city details page by providing
users with easy access to additional information about the
city on WikiData, improving overall user engagement
and knowledge access.
2025-04-02 14:36:31 +08:00
a4fc4d4961 fix: handle image loading errors in views
- Wrap image_tag calls in begin-rescue blocks to catch loading errors
- Log any exceptions to Rails logger for better debugging
- Provide user feedback with a placeholder when images fail to load

These changes improve the robustness of the application by ensuring that errors do not cause disruptions in the user interface.
2025-03-25 17:21:19 +08:00
b33552f6b1 fix: add error handling for image loading
- Implemented error handling for image loading to prevent application
  crashes when an image fails to load.
- Added logging to capture the error message when an image cannot be
  displayed.

This change improves the reliability of the image display feature on
the home page, ensuring that users are not met with a broken layout
if an image fails to load.
2025-03-25 17:15:19 +08:00