Skip to content

Commit 250cad2

Browse files
authored
feat: moved get-involved and guides content (#6172)
* feat: moved get-involved and guides content * fix: fixed for old legacy design * fix: some redirect fixes * chore: getting started should be learn index
1 parent 03ebfc9 commit 250cad2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+174
-362
lines changed

components/Docs/NodeApiVersionLinks.tsx

Lines changed: 0 additions & 33 deletions
This file was deleted.

components/Downloads/ChangelogModal/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const ChangelogModal: FC<PropsWithChildren<ChangelogModalProps>> = ({
4040
</Dialog.Description>
4141
<div className={styles.authors}>
4242
<AvatarGroup avatars={avatars} isExpandable={false} />
43-
<Link href="/get-involved">
43+
<Link href="/about/get-involved">
4444
{t('components.downloads.changelogModal.startContributing')}
4545
<ArrowUpRightIcon />
4646
</Link>

components/Downloads/SecondaryDownloadMatrix.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { FC } from 'react';
22

33
import DownloadList from '@/components/Downloads/DownloadList';
4-
import { WithNodeRelease } from '@/components/withNodeRelease';
4+
import WithNodeRelease from '@/components/withNodeRelease';
55
import { useClientContext } from '@/hooks/server';
66
import { DIST_URL } from '@/next.constants.mjs';
77
import type { NodeRelease } from '@/types';

components/SideNavigation.tsx

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,31 @@ import { useSiteNavigation } from '@/hooks/server';
66
import type { NavigationKeys } from '@/types';
77

88
type SideNavigationProps = {
9-
navigationKey: NavigationKeys;
9+
navigationKeys: NavigationKeys[];
1010
context?: Record<string, RichTranslationValues>;
1111
};
1212

1313
const SideNavigation: FC<SideNavigationProps> = ({
14-
navigationKey,
14+
navigationKeys,
1515
context,
1616
}) => {
1717
const { getSideNavigation } = useSiteNavigation();
1818

19-
const [[, sideNavigationItems]] = getSideNavigation([navigationKey], context);
19+
const sideNavigation = getSideNavigation(navigationKeys, context);
20+
21+
const mapItems = (items: ReturnType<typeof getSideNavigation>) => {
22+
return items.map(([, { link, label, items }]) => (
23+
<li key={link}>
24+
{link ? <ActiveLink href={link}>{label}</ActiveLink> : label}
25+
26+
{items && items.length > 0 && <ul>{mapItems(items)}</ul>}
27+
</li>
28+
));
29+
};
2030

2131
return (
2232
<nav aria-label="secondary">
23-
<ul>
24-
{sideNavigationItems.items!.map(([key, { link, label, items }]) => (
25-
<li key={key}>
26-
{link ? <ActiveLink href={link}>{label}</ActiveLink> : label}
27-
28-
{items && items.length > 0 && (
29-
<ul>
30-
{items.map(([key, { link, label }]) => (
31-
<li key={key}>
32-
<ActiveLink href={link}>{label}</ActiveLink>
33-
</li>
34-
))}
35-
</ul>
36-
)}
37-
</li>
38-
))}
39-
</ul>
33+
<ul>{mapItems(sideNavigation)}</ul>
4034
</nav>
4135
);
4236
};

components/withLayout.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import type { FC, PropsWithChildren } from 'react';
33
import LegacyAboutLayout from '@/layouts/AboutLayout';
44
import LegacyBlogCategoryLayout from '@/layouts/BlogCategoryLayout';
55
import LegacyBlogPostLayout from '@/layouts/BlogPostLayout';
6-
import LegacyContributeLayout from '@/layouts/ContributeLayout';
76
import LegacyDefaultLayout from '@/layouts/DefaultLayout';
87
import LegacyDocsLayout from '@/layouts/DocsLayout';
98
import LegacyDownloadLayout from '@/layouts/DownloadLayout';
109
import LegacyIndexLayout from '@/layouts/IndexLayout';
1110
import LegacyLearnLayout from '@/layouts/LearnLayout';
1211
import AboutLayout from '@/layouts/New/About';
1312
import DefaultLayout from '@/layouts/New/Default';
13+
import DocsLayout from '@/layouts/New/Docs';
1414
import { ENABLE_WEBSITE_REDESIGN } from '@/next.constants.mjs';
1515
import type { LegacyLayouts } from '@/types';
1616

@@ -20,7 +20,7 @@ const legacyLayouts = {
2020
'about.hbs': LegacyAboutLayout,
2121
'blog-category.hbs': LegacyBlogCategoryLayout,
2222
'blog-post.hbs': LegacyBlogPostLayout,
23-
'contribute.hbs': LegacyContributeLayout,
23+
'contribute.hbs': LegacyAboutLayout,
2424
'download.hbs': LegacyDownloadLayout,
2525
'index.hbs': LegacyIndexLayout,
2626
'learn.hbs': LegacyLearnLayout,
@@ -29,7 +29,7 @@ const legacyLayouts = {
2929

3030
/** all the currently available layouts from website redesign */
3131
const redesignLayouts = {
32-
'docs.hbs': DefaultLayout,
32+
'docs.hbs': DocsLayout,
3333
'about.hbs': AboutLayout,
3434
'blog-category.hbs': DefaultLayout,
3535
'blog-post.hbs': DefaultLayout,

components/withNodeRelease.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type WithNodeReleaseProps = {
1111
// This is a React Async Server Component
1212
// Note that Hooks cannot be used in a RSC async component
1313
// Async Components do not get re-rendered at all.
14-
export const WithNodeRelease: FC<WithNodeReleaseProps> = async ({
14+
const WithNodeRelease: FC<WithNodeReleaseProps> = async ({
1515
status,
1616
children: Component,
1717
}) => {
@@ -27,3 +27,5 @@ export const WithNodeRelease: FC<WithNodeReleaseProps> = async ({
2727

2828
return null;
2929
};
30+
31+
export default WithNodeRelease;

crowdin.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ files:
99
ignore:
1010
- /pages/en/blog/**/*.md
1111
- /pages/en/learn/**/*.md
12-
- /pages/en/docs/guides/**/*.md
12+
- /pages/en/guides/**/*.md
1313
- /pages/en/download/index.md
1414
- /pages/en/download/current.md
1515
languages_mapping:
@@ -24,7 +24,7 @@ files:
2424
ignore:
2525
- /pages/en/blog/**/*.mdx
2626
- /pages/en/learn/**/*.mdx
27-
- /pages/en/docs/guides/**/*.mdx
27+
- /pages/en/guides/**/*.mdx
2828
languages_mapping:
2929
two_letters_code:
3030
es-ES: es

i18n.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import type { RichTranslationValues } from 'next-intl';
21
import { getRequestConfig } from 'next-intl/server';
32

4-
import { availableLocaleCodes } from './next.locales.mjs';
3+
import { availableLocaleCodes } from '@/next.locales.mjs';
54

65
// Loads the Application Locales/Translations Dynamically
76
const loadLocaleDictionary = async (locale: string) => {
@@ -20,17 +19,10 @@ const loadLocaleDictionary = async (locale: string) => {
2019
throw new Error(`Unsupported locale: ${locale}`);
2120
};
2221

23-
// Defines default Rich Text Components
24-
const defaultRichTextValues: RichTranslationValues = {
25-
graySpan: c => <span className="small color-lightgray">{c}</span>,
26-
};
27-
2822
// Provides `next-intl` configuration for RSC/SSR
2923
export default getRequestConfig(async ({ locale }) => ({
3024
// This is the dictionary of messages to be loaded
3125
messages: await loadLocaleDictionary(locale),
32-
// Default Rich Text Translations
33-
defaultTranslationValues: defaultRichTextValues,
3426
// We always define the App timezone as UTC
3527
timeZone: 'Etc/UTC',
3628
}));

i18n/locales/en.json

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
"about": "About",
1818
"download": "Download",
1919
"docs": "Docs",
20-
"getInvolved": "Get Involved",
20+
"guides": "Guides",
2121
"learn": "Learn",
2222
"security": "Security",
2323
"certification": "Certification",
24-
"blog": "News"
24+
"blog": "Blog"
2525
},
2626
"buttons": {
2727
"toggleLanguage": "Toggle Language",
@@ -87,16 +87,6 @@
8787
"security": "Security Reporting"
8888
}
8989
},
90-
"docs": {
91-
"links": {
92-
"docs": "Docs",
93-
"es6": "ES6 and beyond",
94-
"apiLts": "{fullLtsNodeVersion} API <graySpan>LTS</graySpan>",
95-
"apiCurrent": "{fullCurrentNodeVersion} API",
96-
"guides": "Guides <graySpan>ARCHIVE</graySpan>",
97-
"dependencies": "Dependencies"
98-
}
99-
},
10090
"getInvolved": {
10191
"links": {
10292
"getInvolved": "Get Involved",

layouts/AboutLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import SideNavigation from '@/components/SideNavigation';
44

55
const AboutLayout: FC<PropsWithChildren> = ({ children }) => (
66
<div className="has-side-nav container">
7-
<SideNavigation navigationKey="about" />
7+
<SideNavigation navigationKeys={['about', 'getInvolved']} />
88
<article dir="auto">{children}</article>
99
</div>
1010
);

0 commit comments

Comments
 (0)