Skip to content

Commit 6a09ab5

Browse files
authored
feat: add AI Coding Assistants Policy to footer (#8807)
* Add AI Coding Assistants Policy to footer * Update footer links order * Fix external links in sitemap
1 parent 3036b2d commit 6a09ab5

File tree

5 files changed

+34
-22
lines changed

5 files changed

+34
-22
lines changed

apps/site/app/sitemap.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { availableLocaleCodes, defaultLocale } from '@node-core/website-i18n';
22

3-
import { BASE_PATH } from '#site/next.constants.mjs';
4-
import { BASE_URL } from '#site/next.constants.mjs';
5-
import { EXTERNAL_LINKS_SITEMAP } from '#site/next.constants.mjs';
3+
import {
4+
BASE_PATH,
5+
BASE_URL,
6+
EXTERNAL_LINKS_SITEMAP,
7+
} from '#site/next.constants.mjs';
68
import { BLOG_DYNAMIC_ROUTES } from '#site/next.dynamic.constants.mjs';
79
import { dynamicRouter } from '#site/next.dynamic.mjs';
810

@@ -16,8 +18,11 @@ const nonDefaultLocales = availableLocaleCodes.filter(
1618
l => l !== defaultLocale.code
1719
);
1820

19-
const getAlternatePath = (r: string, locales: Array<string>) =>
20-
Object.fromEntries(locales.map(l => [l, `${baseUrlAndPath}/${l}/${r}`]));
21+
const getFullPath = (r: string, l: string) =>
22+
/^https?:\/\//.test(r) ? r : `${baseUrlAndPath}/${l}/${r}`;
23+
24+
const getAlternatePaths = (r: string, locales: Array<string>) =>
25+
Object.fromEntries(locales.map(l => [l, getFullPath(r, l)]));
2126

2227
// This allows us to generate a `sitemap.xml` file dynamically based on the needs of the Node.js Website
2328
const sitemap = async (): Promise<MetadataRoute.Sitemap> => {
@@ -27,10 +32,10 @@ const sitemap = async (): Promise<MetadataRoute.Sitemap> => {
2732
const currentDate = new Date().toISOString();
2833

2934
const getSitemapEntry = (r: string, locales: Array<string> = []) => ({
30-
url: `${baseUrlAndPath}/${defaultLocale.code}/${r}`,
35+
url: getFullPath(r, defaultLocale.code),
3136
lastModified: currentDate,
3237
changeFrequency: 'always' as const,
33-
alternates: { languages: getAlternatePath(r, locales) },
38+
alternates: { languages: getAlternatePaths(r, locales) },
3439
});
3540

3641
const staticPaths = routes.map(r => getSitemapEntry(r, nonDefaultLocales));

apps/site/components/withLegal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const RICH_TRANSLATION_KEYS = [
2323
'foundationName',
2424
'trademarkPolicy',
2525
'trademarkList',
26+
'aiCodingAssistantsPolicy',
2627
'termsOfUse',
2728
'privacyPolicy',
2829
'bylaws',

apps/site/navigation.json

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,36 +37,40 @@
3737
"text": "components.containers.footer.links.foundationName"
3838
},
3939
{
40-
"link": "https://terms-of-use.openjsf.org/",
41-
"text": "components.containers.footer.links.termsOfUse"
42-
},
43-
{
44-
"link": "https://privacy-policy.openjsf.org/",
45-
"text": "components.containers.footer.links.privacyPolicy"
40+
"link": "https://ai-coding-assistants-policy.openjsf.org/",
41+
"text": "components.containers.footer.links.aiCodingAssistantsPolicy"
4642
},
4743
{
4844
"link": "https://bylaws.openjsf.org/",
4945
"text": "components.containers.footer.links.bylaws"
5046
},
5147
{
52-
"link": "https://github.com/openjs-foundation/cross-project-council/blob/main/CODE_OF_CONDUCT.md",
48+
"link": "https://code-of-conduct.openjsf.org/",
5349
"text": "components.containers.footer.links.codeOfConduct"
5450
},
55-
{
56-
"link": "https://trademark-policy.openjsf.org/",
57-
"text": "components.containers.footer.links.trademarkPolicy"
58-
},
59-
{
60-
"link": "https://trademark-list.openjsf.org/",
61-
"text": "components.containers.footer.links.trademarkList"
62-
},
6351
{
6452
"link": "https://www.linuxfoundation.org/cookies/",
6553
"text": "components.containers.footer.links.cookiePolicy"
6654
},
55+
{
56+
"link": "https://privacy-policy.openjsf.org/",
57+
"text": "components.containers.footer.links.privacyPolicy"
58+
},
6759
{
6860
"link": "https://github.com/nodejs/node/security/policy",
6961
"text": "components.containers.footer.links.security"
62+
},
63+
{
64+
"link": "https://terms-of-use.openjsf.org/",
65+
"text": "components.containers.footer.links.termsOfUse"
66+
},
67+
{
68+
"link": "https://trademark-list.openjsf.org/",
69+
"text": "components.containers.footer.links.trademarkList"
70+
},
71+
{
72+
"link": "https://trademark-policy.openjsf.org/",
73+
"text": "components.containers.footer.links.trademarkPolicy"
7074
}
7175
],
7276
"socialLinks": [

apps/site/next.constants.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export const THEME_STORAGE_KEY = 'theme';
107107
* @see https://github.com/nodejs/nodejs.org/issues/5813 for more context
108108
*/
109109
export const EXTERNAL_LINKS_SITEMAP = [
110+
'https://ai-coding-assistants-policy.openjsf.org/',
110111
'https://terms-of-use.openjsf.org/',
111112
'https://privacy-policy.openjsf.org/',
112113
'https://bylaws.openjsf.org/',

packages/i18n/src/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"legal": "Copyright <foundationName>OpenJS Foundation</foundationName> and Node.js contributors. All rights reserved. The <foundationName>OpenJS Foundation</foundationName> has registered trademarks and uses trademarks. For a list of trademarks of the <foundationName>OpenJS Foundation</foundationName>, please see our <trademarkPolicy>Trademark Policy</trademarkPolicy> and <trademarkList>Trademark List</trademarkList>. Trademarks and logos not indicated on the <trademarkList>list of OpenJS Foundation trademarks</trademarkList> are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.",
1414
"links": {
1515
"foundationName": "OpenJS Foundation",
16+
"aiCodingAssistantsPolicy": "AI Coding Assistants Policy",
1617
"termsOfUse": "Terms of Use",
1718
"privacyPolicy": "Privacy Policy",
1819
"bylaws": "Bylaws",

0 commit comments

Comments
 (0)