diff --git a/frontend-next-migration/public/en/sitemap.xml b/frontend-next-migration/public/en/sitemap.xml new file mode 100644 index 000000000..8fded0c9f --- /dev/null +++ b/frontend-next-migration/public/en/sitemap.xml @@ -0,0 +1,69 @@ + + + + https://altzone.fi/en + 2025-01-22 + always + 1.0 + + + https://altzone.fi/en/news + 2025-01-22 + daily + 0.9 + + + https://altzone.fi/en/heroes + 2025-01-23 + monthly + 0.8 + + + https://altzone.fi/en/hero-development + 2025-01-22 + monthly + 0.5 + + + https://altzone.fi/en/clans + 2025-01-23 + daily + 0.8 + + + https://altzone.fi/en/picture-galleries + 2025-01-22 + monthly + 0.6 + + + https://altzone.fi/en/comics + 2025-01-22 + yearly + 0.4 + + + https://altzone.fi/en/furniture + 2025-01-22 + weekly + 0.8 + + + https://altzone.fi/en/artGame + 2025-01-22 + yearly + 0.3 + + + https://altzone.fi/en/join-us + 2025-01-22 + yearly + 0.3 + + + https://altzone.fi/en/team + 2025-01-22 + weekly + 0.5 + + \ No newline at end of file diff --git a/frontend-next-migration/public/fi/sitemap.xml b/frontend-next-migration/public/fi/sitemap.xml new file mode 100644 index 000000000..d6bd2fde0 --- /dev/null +++ b/frontend-next-migration/public/fi/sitemap.xml @@ -0,0 +1,69 @@ + + + + https://altzone.fi/fi + 2025-01-22 + always + 1.0 + + + https://altzone.fi/fi/news + 2025-01-22 + daily + 0.9 + + + https://altzone.fi/fi/heroes + 2025-01-23 + monthly + 0.8 + + + https://altzone.fi/fi/hero-development + 2025-01-22 + monthly + 0.5 + + + https://altzone.fi/fi/clans + 2025-01-23 + daily + 0.8 + + + https://altzone.fi/fi/picture-galleries + 2025-01-22 + monthly + 0.6 + + + https://altzone.fi/fi/comics + 2025-01-22 + yearly + 0.4 + + + https://altzone.fi/fi/furniture + 2025-01-22 + weekly + 0.8 + + + https://altzone.fi/fi/artGame + 2025-01-22 + yearly + 0.3 + + + https://altzone.fi/fi/join-us + 2025-01-22 + yearly + 0.3 + + + https://altzone.fi/fi/team + 2025-01-22 + weekly + 0.5 + + \ No newline at end of file diff --git a/frontend-next-migration/public/robots.txt b/frontend-next-migration/public/robots.txt index 7ed4e7d37..ea627c5fc 100644 --- a/frontend-next-migration/public/robots.txt +++ b/frontend-next-migration/public/robots.txt @@ -1,4 +1,6 @@ User-agent: * -Disallow: +Allow: / -Sitemap: https://altzone.fi/sitemap.xml \ No newline at end of file +Sitemap: https://altzone.fi/sitemap.xml +Sitemap: https://altzone.fi/fi/sitemap.xml +Sitemap: https://altzone.fi/en/sitemap.xml \ No newline at end of file diff --git a/frontend-next-migration/public/sitemap.xml b/frontend-next-migration/public/sitemap.xml new file mode 100644 index 000000000..f604a5243 --- /dev/null +++ b/frontend-next-migration/public/sitemap.xml @@ -0,0 +1,69 @@ + + + + https://altzone.fi + 2025-01-22 + always + 1.0 + + + https://altzone.fi/fi/news + 2025-01-22 + daily + 0.9 + + + https://altzone.fi/fi/heroes + 2025-01-23 + monthly + 0.8 + + + https://altzone.fi/fi/hero-development + 2025-01-22 + monthly + 0.5 + + + https://altzone.fi/fi/clans + 2025-01-23 + daily + 0.8 + + + https://altzone.fi/fi/picture-galleries + 2025-01-22 + monthly + 0.6 + + + https://altzone.fi/fi/comics + 2025-01-22 + yearly + 0.4 + + + https://altzone.fi/fi/furniture + 2025-01-22 + weekly + 0.8 + + + https://altzone.fi/fi/artGame + 2025-01-22 + yearly + 0.3 + + + https://altzone.fi/fi/join-us + 2025-01-22 + yearly + 0.3 + + + https://altzone.fi/fi/team + 2025-01-22 + weekly + 0.5 + + \ No newline at end of file diff --git a/frontend-next-migration/src/app/sitemap.ts b/frontend-next-migration/src/app/sitemap.ts new file mode 100644 index 000000000..004ead5f1 --- /dev/null +++ b/frontend-next-migration/src/app/sitemap.ts @@ -0,0 +1,96 @@ +import type { MetadataRoute } from 'next'; +import { envHelper } from '@/shared/const/envHelper'; + +export const dynamic = 'force-static'; + +/** + * Generate a sitemap.xml file. + * @constant {string} BASE_URL - The base domain for all URLs, fetched from envHelper. + * @returns {MetadataRoute.Sitemap} A Sitemap object that contains page URLs and other information. + * @property {string} url - Page URL. + * @property {Date} lastModified - The last modification date of the page. + * @property {'always'|'daily'|'weekly'|'monthly'|'yearly'|'never'} changefreq - Page change frequency. + * @property {number} priority - Page importance (0.0-1.0). + * Example usage: + * [ + * { + * url: "https://altzone.fi/fi/news", + * lastModified: new Date(), + * changeFrequency: "daily", + * priority: 0.9 + * } + * ] + */ + +const baseUrl = envHelper.appDomain; + +export default function sitemap(): MetadataRoute.Sitemap { + return [ + { + url: `${baseUrl}`, + lastModified: new Date(), + changeFrequency: 'always', + priority: 1.0, + }, + { + url: `${baseUrl}/fi/news`, + lastModified: new Date(), + changeFrequency: 'daily', + priority: 0.9, + }, + { + url: `${baseUrl}/fi/heroes`, + lastModified: new Date(), + changeFrequency: 'monthly', + priority: 0.8, + }, + { + url: `${baseUrl}/fi/hero-development`, + lastModified: new Date(), + changeFrequency: 'monthly', + priority: 0.5, + }, + { + url: `${baseUrl}/fi/clans`, + lastModified: new Date(), + changeFrequency: 'daily', + priority: 0.8, + }, + { + url: `${baseUrl}/fi/picture-galleries`, + lastModified: new Date(), + changeFrequency: 'monthly', + priority: 0.6, + }, + { + url: `${baseUrl}/fi/comics`, + lastModified: new Date(), + changeFrequency: 'yearly', + priority: 0.4, + }, + { + url: `${baseUrl}/fi/furniture`, + lastModified: new Date(), + changeFrequency: 'weekly', + priority: 0.8, + }, + { + url: `${baseUrl}/fi/artGame`, + lastModified: new Date(), + changeFrequency: 'yearly', + priority: 0.3, + }, + { + url: `${baseUrl}/fi/join-us`, + lastModified: new Date(), + changeFrequency: 'yearly', + priority: 0.3, + }, + { + url: `${baseUrl}/fi/team`, + lastModified: new Date(), + changeFrequency: 'weekly', + priority: 0.5, + }, + ]; +} diff --git a/frontend-next-migration/src/shared/const/envHelper.ts b/frontend-next-migration/src/shared/const/envHelper.ts index cc0690057..dc8daeff8 100644 --- a/frontend-next-migration/src/shared/const/envHelper.ts +++ b/frontend-next-migration/src/shared/const/envHelper.ts @@ -15,7 +15,7 @@ export const envHelper = { isDevMode: process.env.NODE_ENV === 'development', apiLink: process.env.NEXT_PUBLIC_API_LINK || '', - appDomain: process.env.NEXT_PUBLIC_APP_DOMAIN || '', + appDomain: process.env.NEXT_PUBLIC_APP_DOMAIN || 'https://altzone.fi', companyName: process.env.COMPANY_NAME || "Psyche's Royale Gaming ry", strapiHost: process.env.NEXT_PUBLIC_STRAPI_HOST || '', directusHost: process.env.NEXT_PUBLIC_DIRECTUS_HOST || '', diff --git a/frontend-next-migration/src/stories/Sitemap.stories.tsx b/frontend-next-migration/src/stories/Sitemap.stories.tsx new file mode 100644 index 000000000..52668715d --- /dev/null +++ b/frontend-next-migration/src/stories/Sitemap.stories.tsx @@ -0,0 +1,25 @@ +import React from 'react'; +import sitemap from '../app/sitemap'; + +export default { + title: 'Sitemap', +}; + +export const SitemapStory = () => { + const sitemapData = sitemap(); + + const containerStyle: React.CSSProperties = { + fontFamily: 'monospace', + whiteSpace: 'pre-wrap', + padding: '16px', + backgroundColor: '#ffffff', + color: '#333333', + }; + + return ( +
+

Sitemap

+
{JSON.stringify(sitemapData, null, 2)}
+
+ ); +};