Skip to content

Commit bb8cc8b

Browse files
authored
chore: add language parameter to routing (#4667)
1 parent ff4a910 commit bb8cc8b

File tree

75 files changed

+161
-166
lines changed

Some content is hidden

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

75 files changed

+161
-166
lines changed

packages/fern-docs/bundle/src/app/[host]/[domain]/dynamic/@explorer/@sidebar/[slug]/page.tsx renamed to packages/fern-docs/bundle/src/app/[host]/[domain]/[lang]/dynamic/@explorer/@sidebar/[slug]/page.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@ import { FernNavigation } from "@fern-api/fdr-sdk";
66
import { slugjoin } from "@fern-api/fdr-sdk/navigation";
77

88
import { getFernToken } from "@/app/fern-token";
9+
import type { PageParams } from "@/app/types";
910
import { PlaygroundEndpointSelectorContent } from "@/components/playground/endpoint/PlaygroundEndpointSelectorContent";
1011
import { flattenApiSection } from "@/components/playground/utils/flatten-apis";
1112

12-
export default async function EndpointSelectorPage({
13-
params
14-
}: {
15-
params: Promise<{ host: string; domain: string; slug: string }>;
16-
}) {
17-
const { host, domain, slug } = await params;
13+
export default async function EndpointSelectorPage({ params }: { params: Promise<PageParams> }) {
14+
const { host, domain, lang, slug } = await params;
1815

1916
const loader = await createCachedDocsLoader(host, domain, await getFernToken());
2017
const root = await loader.getRoot();

packages/fern-docs/bundle/src/app/[host]/[domain]/dynamic/@explorer/[slug]/page.tsx renamed to packages/fern-docs/bundle/src/app/[host]/[domain]/[lang]/dynamic/@explorer/[slug]/page.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@ import { permanentRedirect, RedirectType, redirect } from "next/navigation";
1313
import React from "react";
1414

1515
import { getFernToken } from "@/app/fern-token";
16+
import type { PageParams } from "@/app/types";
1617
import { ExplorerContent, NoEndpointSelected } from "@/components/playground/ExplorerContent";
1718

18-
export default async function ExplorerPage({
19-
params
20-
}: {
21-
params: Promise<{ host: string; domain: string; slug: string }>;
22-
}) {
19+
export default async function ExplorerPage({ params }: { params: Promise<PageParams> }) {
2320
const { host, domain, slug: slugProp } = await params;
2421

2522
if (slugProp.endsWith(".js")) {

packages/fern-docs/bundle/src/app/[host]/[domain]/dynamic/@headertabs/[slug]/page.tsx renamed to packages/fern-docs/bundle/src/app/[host]/[domain]/[lang]/dynamic/@headertabs/[slug]/page.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ import { HeaderTabsList } from "@fern-docs/components/HeaderTabsList";
88

99
import { getFernToken } from "@/app/fern-token";
1010

11-
export default async function HeaderTabsPage({
12-
params
13-
}: {
14-
params: Promise<{ host: string; domain: string; slug: string }>;
15-
}) {
16-
const { host, domain, slug } = await params;
11+
import type { PageParams } from "@/app/types";
12+
13+
export default async function HeaderTabsPage({ params }: { params: Promise<PageParams> }) {
14+
const { host, domain, lang, slug } = await params;
1715
const loader = await createCachedDocsLoader(host, domain, await getFernToken());
1816
const layout = await loader.getLayout();
1917

packages/fern-docs/bundle/src/app/[host]/[domain]/dynamic/@logo/[slug]/page.tsx renamed to packages/fern-docs/bundle/src/app/[host]/[domain]/[lang]/dynamic/@logo/[slug]/page.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@ import { getPageId, slugjoin } from "@fern-api/fdr-sdk/navigation";
77
import { getFrontmatter } from "@fern-docs/mdx";
88

99
import { getFernToken } from "@/app/fern-token";
10+
import type { PageParams } from "@/app/types";
1011
import { Logo } from "@/components/logo";
1112
import { withLogo } from "@/server/withLogo";
1213

13-
export default async function LogoPage({
14-
params
15-
}: {
16-
params: Promise<{ host: string; domain: string; slug: string }>;
17-
}) {
18-
const { host, domain, slug } = await params;
14+
export default async function LogoPage({ params }: { params: Promise<PageParams> }) {
15+
const { host, domain, lang, slug } = await params;
1916
const loader = await createCachedDocsLoader(host, domain, await getFernToken());
2017

2118
const [{ basePath }, config, files, logoUrls, root] = await Promise.all([

packages/fern-docs/bundle/src/app/[host]/[domain]/dynamic/@sidebar/[slug]/page.tsx renamed to packages/fern-docs/bundle/src/app/[host]/[domain]/[lang]/dynamic/@sidebar/[slug]/page.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ import { permanentRedirect, redirect } from "next/navigation";
1919

2020
import { getFernToken } from "@/app/fern-token";
2121

22-
export default async function SidebarPage({
23-
params
24-
}: {
25-
params: Promise<{ host: string; domain: string; slug: string }>;
26-
}) {
27-
const { host, domain, slug } = await params;
22+
import type { PageParams } from "@/app/types";
23+
24+
export default async function SidebarPage({ params }: { params: Promise<PageParams> }) {
25+
const { host, domain, lang, slug } = await params;
2826
const loader = await createCachedDocsLoader(host, domain, await getFernToken());
2927
const [config, baseUrl] = await Promise.all([loader.getConfig(), loader.getMetadata()]);
3028
const isSidebarFixed = getIsSidebarFixed(config);

0 commit comments

Comments
 (0)