Skip to content

Commit 110bde4

Browse files
authored
feat: add legal text + fix analytics (#18)
* feat: add legal text + fix analytics * feat: add legal text + fix analytics * feat: add legal text + fix analytics * feat: add legal text + fix analytics * fixup! * fixup! Signed-off-by: Aviv Keller <[email protected]> * fixup! * fixup! --------- Signed-off-by: Aviv Keller <[email protected]>
1 parent a7352ee commit 110bde4

4 files changed

Lines changed: 117 additions & 5 deletions

File tree

components/Footer/footer.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"socialLinks": [
3+
{
4+
"icon": "github",
5+
"link": "https://github.com/nodejs/node",
6+
"alt": "GitHub"
7+
},
8+
{
9+
"icon": "discord",
10+
"link": "https://discord.gg/nodejs",
11+
"alt": "Discord"
12+
},
13+
{
14+
"icon": "mastodon",
15+
"link": "https://social.lfx.dev/@nodejs",
16+
"alt": "Mastodon"
17+
},
18+
{
19+
"icon": "bluesky",
20+
"link": "https://bsky.app/profile/nodejs.org",
21+
"alt": "Bluesky"
22+
},
23+
{
24+
"icon": "twitter",
25+
"link": "https://twitter.com/nodejs",
26+
"alt": "Twitter"
27+
},
28+
{
29+
"icon": "slack",
30+
"link": "https://slack-invite.openjsf.org/",
31+
"alt": "Slack"
32+
},
33+
{
34+
"icon": "linkedin",
35+
"link": "https://www.linkedin.com/company/node-js",
36+
"alt": "LinkedIn"
37+
}
38+
],
39+
"footerLinks": [
40+
{ "link": "https://openjsf.org/", "text": "OpenJS Foundation" },
41+
{ "link": "https://terms-of-use.openjsf.org/", "text": "Terms of Use" },
42+
{ "link": "https://privacy-policy.openjsf.org/", "text": "Privacy Policy" },
43+
{ "link": "https://bylaws.openjsf.org/", "text": "Bylaws" },
44+
{
45+
"link": "https://github.com/openjs-foundation/cross-project-council/blob/main/CODE_OF_CONDUCT.md",
46+
"text": "Code of Conduct"
47+
},
48+
{
49+
"link": "https://trademark-policy.openjsf.org/",
50+
"text": "Trademark Policy"
51+
},
52+
{ "link": "https://trademark-list.openjsf.org/", "text": "Trademark List" },
53+
{
54+
"link": "https://www.linuxfoundation.org/cookies/",
55+
"text": "Cookie Policy"
56+
},
57+
{
58+
"link": "https://github.com/nodejs/node/security/policy",
59+
"text": "Security Policy"
60+
}
61+
]
62+
}

components/Footer/index.jsx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import Footer from '@node-core/ui-components/Containers/Footer';
2+
import NavItem from '@node-core/ui-components/Containers/NavBar/NavItem';
3+
4+
import { socialLinks, footerLinks } from './footer.json';
5+
6+
// The Node.js Project is legally obligated to include the following text.
7+
// It should not be modified unless explicitly requested by OpenJS staff.
8+
const LegalSlot = (
9+
<>
10+
<p>
11+
Copyright <a href="https://openjsf.org/">OpenJS Foundation</a> and Node.js
12+
contributors. All rights reserved. The{' '}
13+
<a href="https://openjsf.org/">OpenJS Foundation</a> has registered
14+
trademarks and uses trademarks. For a list of trademarks of the{' '}
15+
<a href="https://openjsf.org/">OpenJS Foundation</a>, please see our{' '}
16+
<a href="https://trademark-policy.openjsf.org/">Trademark Policy</a> and{' '}
17+
<a href="https://trademark-list.openjsf.org/">Trademark List</a>.
18+
Trademarks and logos not indicated on the{' '}
19+
<a href="https://trademark-list.openjsf.org/">
20+
list of OpenJS Foundation trademarks
21+
</a>{' '}
22+
are trademarks™ or registered® trademarks of their respective holders. Use
23+
of them does not imply any affiliation with or endorsement by them.
24+
</p>
25+
26+
<p>
27+
{footerLinks.map(({ link, text }) => (
28+
<NavItem key={link} type="footer" href={link}>
29+
{text}
30+
</NavItem>
31+
))}
32+
</p>
33+
</>
34+
);
35+
36+
/**
37+
* Footer component for MDX documentation pages
38+
*/
39+
export default ({ metadata }) => (
40+
<Footer
41+
pathname={metadata.path}
42+
navigation={{ socialLinks }}
43+
slots={{ legal: LegalSlot }}
44+
/>
45+
);

components/Layout/index.jsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import { SpeedInsights } from '@vercel/speed-insights/react';
66
import NavBar from '../Navigation';
77
import MetaBar from '../Metabar';
88
import SideBar from '../Sidebar';
9-
10-
import Footer from '#theme/Footer';
9+
import Footer from '../Footer';
1110

1211
/**
1312
* @typedef {Object} Props
@@ -22,8 +21,8 @@ import Footer from '#theme/Footer';
2221
*/
2322
export default ({ metadata, headings, readingTime, children }) => (
2423
<>
25-
<Analytics />
26-
<SpeedInsights />
24+
<Analytics basePath="/learn/_vercel" />
25+
<SpeedInsights basePath="/learn/_vercel" />
2726
<NavBar />
2827
<Article>
2928
<SideBar metadata={metadata} />
@@ -40,6 +39,6 @@ export default ({ metadata, headings, readingTime, children }) => (
4039
/>
4140
</div>
4241
</Article>
43-
<Footer />
42+
<Footer metadata={metadata} />
4443
</>
4544
);

vercel.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,11 @@
1818
"destination": "/learn/$1",
1919
"permanent": true
2020
}
21+
],
22+
"rewrites": [
23+
{
24+
"source": "/learn/_vercel/(.*)",
25+
"destination": "https://node-learn-pages.vercel.app/_vercel/$1"
26+
}
2127
]
2228
}

0 commit comments

Comments
 (0)