diff --git a/src/app/[locale]/page.tsx b/src/app/[locale]/page.tsx index f3262ad..b901f3d 100644 --- a/src/app/[locale]/page.tsx +++ b/src/app/[locale]/page.tsx @@ -37,7 +37,7 @@ export default async function Page({ params: { locale } }: LocaleParams) {
diff --git a/src/app/sitemap.ts b/src/app/sitemap.ts index 61b5923..fee3738 100644 --- a/src/app/sitemap.ts +++ b/src/app/sitemap.ts @@ -1,41 +1,13 @@ import { MetadataRoute } from "next"; -import { JsFuncTypes } from "@/types/Functions/Javascript"; -import { Langs } from "@/types/Locales"; - const hostUrl: string = process.env.NEXT_PUBLIC_WEBSITE_URL ?? - "https://multiformvalidator.vercel.app"; - -const languages: Langs[] = [ - "en", - "pt", - "ar", - "de", - "es", - "fr", - "it", - "ja", - "nl", - "ru", - "tr", - "zh", -]; - -const ChangeFrequency = { - ALWAYS: "always", - HOURLY: "hourly", - DAILY: "daily", - WEEKLY: "weekly", - MONTHLY: "monthly", - YEARLY: "yearly", - NEVER: "never", -} as const; + "https://multiformvalidator.netlify.app"; function generateJsMaps(): MetadataRoute.Sitemap { const prefix: string = "documentation/js/functions"; - const functions: JsFuncTypes[] = [ + const functions: string[] = [ "cnpjIsValid", "cpfIsValid", "getOnlyEmail", @@ -72,76 +44,207 @@ function generateJsMaps(): MetadataRoute.Sitemap { "validateUSPhoneNumber", ]; - const homeMetadata = functions.map((func) => ({ + return functions.map((func) => ({ url: `${hostUrl}/${prefix}/${func}`, lastModified: new Date(), - changeFrequency: ChangeFrequency.MONTHLY, + changeFrequency: "monthly", priority: 0.9, + alternates: { + languages: { + en: `${hostUrl}/en/${prefix}/${func}`, + pt: `${hostUrl}/pt/${prefix}/${func}`, + ar: `${hostUrl}/ar/${prefix}/${func}`, + de: `${hostUrl}/de/${prefix}/${func}`, + es: `${hostUrl}/es/${prefix}/${func}`, + fr: `${hostUrl}/fr/${prefix}/${func}`, + it: `${hostUrl}/it/${prefix}/${func}`, + ja: `${hostUrl}/ja/${prefix}/${func}`, + nl: `${hostUrl}/nl/${prefix}/${func}`, + ru: `${hostUrl}/ru/${prefix}/${func}`, + tr: `${hostUrl}/tr/${prefix}/${func}`, + zh: `${hostUrl}/zh/${prefix}/${func}`, + }, + }, })); - - const alternatesMetadata = functions.flatMap((func) => - languages.map((lang) => ({ - url: `${hostUrl}/${lang}/${prefix}/${func}`, - lastModified: new Date(), - changeFrequency: ChangeFrequency.MONTHLY, - priority: 0.9, - })), - ); - - const metadata = [...homeMetadata, ...alternatesMetadata]; - - return metadata; } -function generateBasicMetadata(): MetadataRoute.Sitemap { - const homeMetadata: MetadataRoute.Sitemap = [ +export default function sitemap(): MetadataRoute.Sitemap { + return [ { url: hostUrl, lastModified: new Date(), changeFrequency: "monthly", priority: 0.5, + alternates: { + languages: { + en: `${hostUrl}/en`, + pt: `${hostUrl}/pt`, + ar: `${hostUrl}/ar`, + de: `${hostUrl}/de`, + es: `${hostUrl}/es`, + fr: `${hostUrl}/fr`, + it: `${hostUrl}/it`, + ja: `${hostUrl}/ja`, + nl: `${hostUrl}/nl`, + ru: `${hostUrl}/ru`, + tr: `${hostUrl}/tr`, + zh: `${hostUrl}/zh`, + }, + }, }, { url: `${hostUrl}/documentation`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.6, + alternates: { + languages: { + en: `${hostUrl}/en/documentation`, + pt: `${hostUrl}/pt/documentation`, + ar: `${hostUrl}/ar/documentation`, + de: `${hostUrl}/de/documentation`, + es: `${hostUrl}/es/documentation`, + fr: `${hostUrl}/fr/documentation`, + it: `${hostUrl}/it/documentation`, + ja: `${hostUrl}/ja/documentation`, + nl: `${hostUrl}/nl/documentation`, + ru: `${hostUrl}/ru/documentation`, + tr: `${hostUrl}/tr/documentation`, + zh: `${hostUrl}/zh/documentation`, + }, + }, }, { url: `${hostUrl}/documentation/py`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.8, + alternates: { + languages: { + en: `${hostUrl}/en/documentation/py`, + pt: `${hostUrl}/pt/documentation/py`, + ar: `${hostUrl}/ar/documentation/py`, + de: `${hostUrl}/de/documentation/py`, + es: `${hostUrl}/es/documentation/py`, + fr: `${hostUrl}/fr/documentation/py`, + it: `${hostUrl}/it/documentation/py`, + ja: `${hostUrl}/ja/documentation/py`, + nl: `${hostUrl}/nl/documentation/py`, + ru: `${hostUrl}/ru/documentation/py`, + tr: `${hostUrl}/tr/documentation/py`, + zh: `${hostUrl}/zh/documentation/py`, + }, + }, }, { url: `${hostUrl}/documentation/js`, lastModified: new Date(), changeFrequency: "monthly", priority: 1, + alternates: { + languages: { + en: `${hostUrl}/en/documentation/js`, + pt: `${hostUrl}/pt/documentation/js`, + ar: `${hostUrl}/ar/documentation/js`, + de: `${hostUrl}/de/documentation/js`, + es: `${hostUrl}/es/documentation/js`, + fr: `${hostUrl}/fr/documentation/js`, + it: `${hostUrl}/it/documentation/js`, + ja: `${hostUrl}/ja/documentation/js`, + nl: `${hostUrl}/nl/documentation/js`, + ru: `${hostUrl}/ru/documentation/js`, + tr: `${hostUrl}/tr/documentation/js`, + zh: `${hostUrl}/zh/documentation/js`, + }, + }, }, { url: `${hostUrl}/about`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.6, + alternates: { + languages: { + en: `${hostUrl}/en/about`, + pt: `${hostUrl}/pt/about`, + ar: `${hostUrl}/ar/about`, + de: `${hostUrl}/de/about`, + es: `${hostUrl}/es/about`, + fr: `${hostUrl}/fr/about`, + it: `${hostUrl}/it/about`, + ja: `${hostUrl}/ja/about`, + nl: `${hostUrl}/nl/about`, + ru: `${hostUrl}/ru/about`, + tr: `${hostUrl}/tr/about`, + zh: `${hostUrl}/zh/about`, + }, + }, }, { url: `${hostUrl}/terms`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.3, + alternates: { + languages: { + en: `${hostUrl}/en/terms`, + pt: `${hostUrl}/pt/terms`, + ar: `${hostUrl}/ar/terms`, + de: `${hostUrl}/de/terms`, + es: `${hostUrl}/es/terms`, + fr: `${hostUrl}/fr/terms`, + it: `${hostUrl}/it/terms`, + ja: `${hostUrl}/ja/terms`, + nl: `${hostUrl}/nl/terms`, + ru: `${hostUrl}/ru/terms`, + tr: `${hostUrl}/tr/terms`, + zh: `${hostUrl}/zh/terms`, + }, + }, }, { url: `${hostUrl}/privacity-polices`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.3, + alternates: { + languages: { + en: `${hostUrl}/en/privacity-polices`, + pt: `${hostUrl}/pt/privacity-polices`, + ar: `${hostUrl}/ar/privacity-polices`, + de: `${hostUrl}/de/privacity-polices`, + es: `${hostUrl}/es/privacity-polices`, + fr: `${hostUrl}/fr/privacity-polices`, + it: `${hostUrl}/it/privacity-polices`, + ja: `${hostUrl}/ja/privacity-polices`, + nl: `${hostUrl}/nl/privacity-polices`, + ru: `${hostUrl}/ru/privacity-polices`, + tr: `${hostUrl}/tr/privacity-polices`, + zh: `${hostUrl}/zh/privacity-polices`, + }, + }, }, { url: `${hostUrl}/info`, lastModified: new Date(), changeFrequency: "monthly", priority: 0.5, + alternates: { + languages: { + en: `${hostUrl}/en/info`, + pt: `${hostUrl}/pt/info`, + ar: `${hostUrl}/ar/info`, + de: `${hostUrl}/de/info`, + es: `${hostUrl}/es/info`, + fr: `${hostUrl}/fr/info`, + it: `${hostUrl}/it/info`, + ja: `${hostUrl}/ja/info`, + nl: `${hostUrl}/nl/info`, + ru: `${hostUrl}/ru/info`, + tr: `${hostUrl}/tr/info`, + zh: `${hostUrl}/zh/info`, + }, + }, }, { url: `${hostUrl}/news`, @@ -149,70 +252,6 @@ function generateBasicMetadata(): MetadataRoute.Sitemap { changeFrequency: "monthly", priority: 0.2, }, + ...generateJsMaps(), ]; - - const alternatesMetadata: MetadataRoute.Sitemap = languages.flatMap( - (lang) => [ - { - url: `${hostUrl}/${lang}`, - lastModified: new Date(), - changeFrequency: "monthly", - priority: 0.5, - }, - { - url: `${hostUrl}/${lang}/documentation`, - lastModified: new Date(), - changeFrequency: "monthly", - priority: 0.6, - }, - { - url: `${hostUrl}/${lang}/documentation/py`, - lastModified: new Date(), - changeFrequency: "monthly", - priority: 0.8, - }, - { - url: `${hostUrl}/${lang}/documentation/js`, - lastModified: new Date(), - changeFrequency: "monthly", - priority: 1, - }, - { - url: `${hostUrl}/${lang}/about`, - lastModified: new Date(), - changeFrequency: "monthly", - priority: 0.6, - }, - { - url: `${hostUrl}/${lang}/terms`, - lastModified: new Date(), - changeFrequency: "monthly", - priority: 0.3, - }, - { - url: `${hostUrl}/${lang}/privacity-polices`, - lastModified: new Date(), - changeFrequency: "monthly", - priority: 0.3, - }, - { - url: `${hostUrl}/${lang}/info`, - lastModified: new Date(), - changeFrequency: "monthly", - priority: 0.5, - }, - { - url: `${hostUrl}/${lang}/news`, - lastModified: new Date(), - changeFrequency: "monthly", - priority: 0.2, - }, - ], - ); - - return [...homeMetadata, ...alternatesMetadata]; -} - -export default function sitemap(): MetadataRoute.Sitemap { - return [...generateBasicMetadata(), ...generateJsMaps()]; } diff --git a/src/locales/ar/ar.json b/src/locales/ar/ar.json index 58ef878..f9ccf7d 100644 --- a/src/locales/ar/ar.json +++ b/src/locales/ar/ar.json @@ -103,7 +103,8 @@ "Welcome": "مرحبا بك في موقع التحقق من صحة النماذج المتعددة", "SeeTheGithubSourceCode": "راجع مصدر جيثب", "ForMoreInfo": "لمزيد من المعلومات", - "SeeTheNpmPage": "انظر صفحة npm" + "SeeTheNpmPage": "انظر صفحة npm", + "SeeTheJitPackPage": "انظر صفحة جيتباك" }, "DocumentationJsFunctions": { "Alternatively, you can import the function using CommonJS syntax with": "بدلا من ذلك ، يمكنك استيراد الوظيفة باستخدام بناء جملة CommonJS مع", diff --git a/src/locales/de/de.json b/src/locales/de/de.json index 5dca45c..23ccbcd 100644 --- a/src/locales/de/de.json +++ b/src/locales/de/de.json @@ -103,7 +103,8 @@ "Welcome": "Willkommen auf der Website des Multiform-Validators", "SeeTheGithubSourceCode": "Siehe die Github-Quelle", "ForMoreInfo": "Weitere Informationen", - "SeeTheNpmPage": "Siehe die npm-Seite" + "SeeTheNpmPage": "Siehe die npm-Seite", + "SeeTheJitPackPage": "Siehe die Jitpack-Seite" }, "DocumentationJsFunctions": { "Alternatively, you can import the function using CommonJS syntax with": "Alternativ können Sie die Funktion mit der CommonJS-Syntax mit", diff --git a/src/locales/en/en.json b/src/locales/en/en.json index a116009..ac89af4 100644 --- a/src/locales/en/en.json +++ b/src/locales/en/en.json @@ -27,6 +27,7 @@ "SeeTheGithubSourceCode": "See the github source", "SeeTheNpmPage": "See the npm page", "SeeThePypiPage": "See the pypi page", + "SeeTheJitPackPage": "See the jitpack page", "HelpMsg": "You can also help the programmer by buying a coffee at the link below, thanks in advance (:" }, "HomeLayout": { diff --git a/src/locales/es/es.json b/src/locales/es/es.json index df9ab6e..f6016be 100644 --- a/src/locales/es/es.json +++ b/src/locales/es/es.json @@ -103,7 +103,8 @@ "Welcome": "Bienvenido al sitio web de multiform-validator", "SeeTheGithubSourceCode": "Ver el código fuente de github", "ForMoreInfo": "Para más información", - "SeeTheNpmPage": "Ver la página de npm" + "SeeTheNpmPage": "Ver la página de npm", + "SeeTheJitPackPage": "Ver la página de jitpack" }, "DocumentationJsFunctions": { "Alternatively, you can import the function using CommonJS syntax with": "Como alternativa, puede importar la función utilizando la sintaxis de CommonJS con", diff --git a/src/locales/fr/fr.json b/src/locales/fr/fr.json index cac561e..42d64e2 100644 --- a/src/locales/fr/fr.json +++ b/src/locales/fr/fr.json @@ -103,7 +103,8 @@ "Welcome": "Bienvenue sur le site du validateur multiformulaire", "SeeTheGithubSourceCode": "Voir le code source github", "ForMoreInfo": "Pour plus d’informations", - "SeeTheNpmPage": "Voir la page npm" + "SeeTheNpmPage": "Voir la page npm", + "SeeTheJitPackPage": "Voir la page jitpack" }, "DocumentationJsFunctions": { "Alternatively, you can import the function using CommonJS syntax with": "Vous pouvez également importer la fonction en utilisant la syntaxe CommonJS avec", diff --git a/src/locales/it/it.json b/src/locales/it/it.json index 9ec24ab..fc26dff 100644 --- a/src/locales/it/it.json +++ b/src/locales/it/it.json @@ -103,7 +103,8 @@ "Welcome": "Benvenuti nel sito web di multiform-validator", "SeeTheGithubSourceCode": "Vedi il codice sorgente di Github", "ForMoreInfo": "Per maggiori informazioni", - "SeeTheNpmPage": "Vedi la pagina npm" + "SeeTheNpmPage": "Vedi la pagina npm", + "SeeTheJitPackPage": "Vedi la pagina jitpack" }, "DocumentationJsFunctions": { "Alternatively, you can import the function using CommonJS syntax with": "In alternativa, è possibile importare la funzione utilizzando la sintassi CommonJS con", diff --git a/src/locales/ja/ja.json b/src/locales/ja/ja.json index aa3ec63..a1e4b23 100644 --- a/src/locales/ja/ja.json +++ b/src/locales/ja/ja.json @@ -103,7 +103,8 @@ "Welcome": "multiform-validator の Web サイトへようこそ", "SeeTheGithubSourceCode": "githubのソースを参照してください", "ForMoreInfo": "詳細情報", - "SeeTheNpmPage": "npm のページを参照してください" + "SeeTheNpmPage": "npm のページを参照してください", + "SeeTheJitPackPage": "jitpack のページを参照してください" }, "DocumentationJsFunctions": { "Alternatively, you can import the function using CommonJS syntax with": "または、CommonJS 構文を使用して関数をインポートすることもできます。", diff --git a/src/locales/nl/nl.json b/src/locales/nl/nl.json index 669f643..509c5fa 100644 --- a/src/locales/nl/nl.json +++ b/src/locales/nl/nl.json @@ -103,7 +103,8 @@ "Welcome": "Welkom op de website van de multiform-validator", "SeeTheGithubSourceCode": "De github-bron bekijken", "ForMoreInfo": "Voor meer informatie", - "SeeTheNpmPage": "Zie de npm pagina" + "SeeTheNpmPage": "Zie de npm pagina", + "SeeTheJitPackPage": "Bekijk de jitpack pagina" }, "DocumentationJsFunctions": { "Alternatively, you can import the function using CommonJS syntax with": "U kunt de functie ook importeren met behulp van de CommonJS-syntaxis met", diff --git a/src/locales/pt/pt.json b/src/locales/pt/pt.json index efe685a..1ddba5d 100644 --- a/src/locales/pt/pt.json +++ b/src/locales/pt/pt.json @@ -27,6 +27,7 @@ "SeeTheGithubSourceCode": "Veja o código-fonte no GitHub", "SeeTheNpmPage": "Veja a página no NPM", "SeeThePypiPage": "Veja a página no PyPI", + "SeeTheJitPackPage": "Veja a página no JitPack", "HelpMsg": "Você também pode ajudar o programador comprando um café no link abaixo, desde já agradeço (:" }, "HomeLayout": { diff --git a/src/locales/ru/ru.json b/src/locales/ru/ru.json index 31d6831..7e11b1f 100644 --- a/src/locales/ru/ru.json +++ b/src/locales/ru/ru.json @@ -103,7 +103,8 @@ "Welcome": "Добро пожаловать на сайт multiform-validator", "SeeTheGithubSourceCode": "Смотрите исходный код github", "ForMoreInfo": "Дополнительная информация", - "SeeTheNpmPage": "Смотрите страницу npm" + "SeeTheNpmPage": "Смотрите страницу npm", + "SeeTheJitPackPage": "Смотрите страницу jitpack" }, "DocumentationJsFunctions": { "Alternatively, you can import the function using CommonJS syntax with": "Кроме того, вы можете импортировать функцию, используя синтаксис CommonJS с помощью", diff --git a/src/locales/tr/tr.json b/src/locales/tr/tr.json index bba188a..9fbf8de 100644 --- a/src/locales/tr/tr.json +++ b/src/locales/tr/tr.json @@ -103,7 +103,8 @@ "Welcome": "Çok biçimli doğrulayıcı web sitesine hoş geldiniz", "SeeTheGithubSourceCode": "Github kaynağına bakın", "ForMoreInfo": "Daha fazla bilgi için", - "SeeTheNpmPage": "npm sayfasına bakın" + "SeeTheNpmPage": "npm sayfasına bakın", + "SeeTheJitPackPage": "Jitpack sayfasına bakın" }, "DocumentationJsFunctions": { "Alternatively, you can import the function using CommonJS syntax with": "Alternatif olarak, CommonJS sözdizimini kullanarak işlevi içe aktarabilirsiniz.", diff --git a/src/locales/zh-Hans/zh-Hans.json b/src/locales/zh-Hans/zh-Hans.json index 10bc9f4..bae0016 100644 --- a/src/locales/zh-Hans/zh-Hans.json +++ b/src/locales/zh-Hans/zh-Hans.json @@ -103,7 +103,8 @@ "Welcome": "欢迎访问 multiform-validator 网站", "SeeTheGithubSourceCode": "查看 github 源代码", "ForMoreInfo": "更多信息", - "SeeTheNpmPage": "查看 npm 页面" + "SeeTheNpmPage": "查看 npm 页面", + "SeeTheJitPackPage": "查看 jitpack 页面" }, "DocumentationJsFunctions": { "Alternatively, you can import the function using CommonJS syntax with": "或者,您可以使用 CommonJS 语法导入函数",