diff --git a/apps/site/app/sitemap.ts b/apps/site/app/sitemap.ts index 68de1f7ceb13e..b676da5193467 100644 --- a/apps/site/app/sitemap.ts +++ b/apps/site/app/sitemap.ts @@ -1,8 +1,10 @@ import { availableLocaleCodes, defaultLocale } from '@node-core/website-i18n'; -import { BASE_PATH } from '#site/next.constants.mjs'; -import { BASE_URL } from '#site/next.constants.mjs'; -import { EXTERNAL_LINKS_SITEMAP } from '#site/next.constants.mjs'; +import { + BASE_PATH, + BASE_URL, + EXTERNAL_LINKS_SITEMAP, +} from '#site/next.constants.mjs'; import { BLOG_DYNAMIC_ROUTES } from '#site/next.dynamic.constants.mjs'; import { dynamicRouter } from '#site/next.dynamic.mjs'; @@ -16,8 +18,11 @@ const nonDefaultLocales = availableLocaleCodes.filter( l => l !== defaultLocale.code ); -const getAlternatePath = (r: string, locales: Array) => - Object.fromEntries(locales.map(l => [l, `${baseUrlAndPath}/${l}/${r}`])); +const getFullPath = (r: string, l: string) => + /^https?:\/\//.test(r) ? r : `${baseUrlAndPath}/${l}/${r}`; + +const getAlternatePaths = (r: string, locales: Array) => + Object.fromEntries(locales.map(l => [l, getFullPath(r, l)])); // This allows us to generate a `sitemap.xml` file dynamically based on the needs of the Node.js Website const sitemap = async (): Promise => { @@ -27,10 +32,10 @@ const sitemap = async (): Promise => { const currentDate = new Date().toISOString(); const getSitemapEntry = (r: string, locales: Array = []) => ({ - url: `${baseUrlAndPath}/${defaultLocale.code}/${r}`, + url: getFullPath(r, defaultLocale.code), lastModified: currentDate, changeFrequency: 'always' as const, - alternates: { languages: getAlternatePath(r, locales) }, + alternates: { languages: getAlternatePaths(r, locales) }, }); const staticPaths = routes.map(r => getSitemapEntry(r, nonDefaultLocales)); diff --git a/apps/site/components/withLegal.tsx b/apps/site/components/withLegal.tsx index 45d76b20e38ee..01d8f69f12b3a 100644 --- a/apps/site/components/withLegal.tsx +++ b/apps/site/components/withLegal.tsx @@ -23,6 +23,7 @@ const RICH_TRANSLATION_KEYS = [ 'foundationName', 'trademarkPolicy', 'trademarkList', + 'aiCodingAssistantsPolicy', 'termsOfUse', 'privacyPolicy', 'bylaws', diff --git a/apps/site/navigation.json b/apps/site/navigation.json index 91674aec368f6..65d0e9f69b295 100644 --- a/apps/site/navigation.json +++ b/apps/site/navigation.json @@ -37,36 +37,40 @@ "text": "components.containers.footer.links.foundationName" }, { - "link": "https://terms-of-use.openjsf.org/", - "text": "components.containers.footer.links.termsOfUse" - }, - { - "link": "https://privacy-policy.openjsf.org/", - "text": "components.containers.footer.links.privacyPolicy" + "link": "https://ai-coding-assistants-policy.openjsf.org/", + "text": "components.containers.footer.links.aiCodingAssistantsPolicy" }, { "link": "https://bylaws.openjsf.org/", "text": "components.containers.footer.links.bylaws" }, { - "link": "https://github.com/openjs-foundation/cross-project-council/blob/main/CODE_OF_CONDUCT.md", + "link": "https://code-of-conduct.openjsf.org/", "text": "components.containers.footer.links.codeOfConduct" }, - { - "link": "https://trademark-policy.openjsf.org/", - "text": "components.containers.footer.links.trademarkPolicy" - }, - { - "link": "https://trademark-list.openjsf.org/", - "text": "components.containers.footer.links.trademarkList" - }, { "link": "https://www.linuxfoundation.org/cookies/", "text": "components.containers.footer.links.cookiePolicy" }, + { + "link": "https://privacy-policy.openjsf.org/", + "text": "components.containers.footer.links.privacyPolicy" + }, { "link": "https://github.com/nodejs/node/security/policy", "text": "components.containers.footer.links.security" + }, + { + "link": "https://terms-of-use.openjsf.org/", + "text": "components.containers.footer.links.termsOfUse" + }, + { + "link": "https://trademark-list.openjsf.org/", + "text": "components.containers.footer.links.trademarkList" + }, + { + "link": "https://trademark-policy.openjsf.org/", + "text": "components.containers.footer.links.trademarkPolicy" } ], "socialLinks": [ diff --git a/apps/site/next.constants.mjs b/apps/site/next.constants.mjs index c90c61711b7c6..1a4ca677ba8bc 100644 --- a/apps/site/next.constants.mjs +++ b/apps/site/next.constants.mjs @@ -107,6 +107,7 @@ export const THEME_STORAGE_KEY = 'theme'; * @see https://github.com/nodejs/nodejs.org/issues/5813 for more context */ export const EXTERNAL_LINKS_SITEMAP = [ + 'https://ai-coding-assistants-policy.openjsf.org/', 'https://terms-of-use.openjsf.org/', 'https://privacy-policy.openjsf.org/', 'https://bylaws.openjsf.org/', diff --git a/packages/i18n/src/locales/en.json b/packages/i18n/src/locales/en.json index 66b7105768229..d177c91c3a4ef 100644 --- a/packages/i18n/src/locales/en.json +++ b/packages/i18n/src/locales/en.json @@ -13,6 +13,7 @@ "legal": "Copyright OpenJS Foundation and Node.js contributors. All rights reserved. The OpenJS Foundation has registered trademarks and uses trademarks. For a list of trademarks of the OpenJS Foundation, please see our Trademark Policy and Trademark List. Trademarks and logos not indicated on the list of OpenJS Foundation trademarks are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.", "links": { "foundationName": "OpenJS Foundation", + "aiCodingAssistantsPolicy": "AI Coding Assistants Policy", "termsOfUse": "Terms of Use", "privacyPolicy": "Privacy Policy", "bylaws": "Bylaws",