Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jarno/feature/84-add-sitemap #370

Open
wants to merge 14 commits into
base: dev
Choose a base branch
from
Open

Conversation

Rutjake
Copy link
Contributor

@Rutjake Rutjake commented Jan 27, 2025

📄 Pull Request Overview

closes #84

🔧 Changes Made

Created sitemap.ts, which should automatically create sitemap.xml. The current next.js version does not support localization, but I made a function without it. This feature can be easily added after updating Next. I also added a general sitemap.xml file as well as fi/sitemap.xml and en/sitemap.xml, so that sitemaps work in both languages ​​when searched (localization). I created the files manually because the current Next project has either a version or configuration issue with the automatic sitemap.xml creation, which I couldn't figure out. I modified robots.txt so that search engine crawlers can find the sitemaps. Added the component to Storybook, where it worked as expected.

  1. [Any refactoring or clean-up tasks]

Checklist Before Submission

I have tested my code, and it works as expected in Storybook.
I have added or updated JSDoc comments for all relevant code.


📝 Additional Information

The current Next version does not support localization in the sitemap component.
Prioritization and page update information may need updating. After creating new pages, it is a good idea to update the component and the xml files.

export default function sitemap(): MetadataRoute.Sitemap {
return [
{
url: 'https://altzone.fi',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use envHelper instead harcoding

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean just the domain or also the subpages?

@Jonroi Jonroi requested a review from leolabdev February 5, 2025 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants