|
6 | 6 | repositories, |
7 | 7 | getVersionBySlug, |
8 | 8 | } from "@/lib/repo-config"; |
9 | | -import { notFound } from "next/navigation"; |
| 9 | +import { notFound, redirect } from "next/navigation"; |
10 | 10 | import { DocPageHeading } from "../../components"; |
11 | 11 | import { source } from "@/lib/source"; |
12 | 12 | import { createMdxComponents, createRelativeLink } from "@/components/mdx"; |
@@ -38,54 +38,56 @@ export default async function Page(props: Props) { |
38 | 38 | <DocsPage> |
39 | 39 | <DocPageHeading repository={repository} /> |
40 | 40 | <DocsBody> |
41 | | - <Cards> |
42 | | - {version.limited_files?.map((file) => ( |
43 | | - <Card |
44 | | - key={file.slug} |
45 | | - href={`/docs/${repoSlug}/${versionSlug}/${file.slug}`} |
46 | | - title={file.title} |
47 | | - className="flex items-center gap-2" |
48 | | - /> |
49 | | - ))} |
50 | | - </Cards> |
| 41 | + <Cards> |
| 42 | + {version.limited_files?.map((file) => ( |
| 43 | + <Card |
| 44 | + key={file.slug} |
| 45 | + href={`/docs/${repoSlug}/${versionSlug}/${file.slug}`} |
| 46 | + title={file.title} |
| 47 | + className="flex items-center gap-2" |
| 48 | + /> |
| 49 | + ))} |
| 50 | + </Cards> |
51 | 51 | </DocsBody> |
52 | 52 | </DocsPage> |
53 | 53 | ); |
54 | 54 | } |
55 | | - |
56 | | - let content = await page.data.load(); |
57 | | - |
58 | | - if (content.source) { |
59 | | - const sourcePage = source.getPage(content.source.split("/")); |
60 | | - |
61 | | - if (!sourcePage) |
62 | | - throw new Error( |
63 | | - `unresolved source in frontmatter of ${page.file.path}: ${content.source}`, |
64 | | - ); |
65 | | - content = await sourcePage.data.load(); |
66 | | - } |
67 | | - |
68 | | - const MdxContent = content.body; |
69 | | - |
70 | | - return ( |
71 | | - <DocsPage toc={content.toc} full={content.full}> |
72 | | - <DocPageHeading repository={repository} /> |
73 | | - <DocsBody> |
74 | | - <MdxContent |
75 | | - components={createMdxComponents({ |
76 | | - a: ({ href, ...props }: { href: string }) => { |
77 | | - return ( |
78 | | - <a |
79 | | - href={createRelativeLink(repository, version, href)} |
80 | | - {...props} |
81 | | - /> |
82 | | - ); |
83 | | - }, |
84 | | - })} |
85 | | - /> |
86 | | - </DocsBody> |
87 | | - </DocsPage> |
88 | | - ); |
| 55 | + |
| 56 | + redirect(`/docs/${repoSlug}/${versionSlug}/overview`); |
| 57 | + |
| 58 | + // let content = await page.data.load(); |
| 59 | + |
| 60 | + // if (content.source) { |
| 61 | + // const sourcePage = source.getPage(content.source.split("/")); |
| 62 | + |
| 63 | + // if (!sourcePage) |
| 64 | + // throw new Error( |
| 65 | + // `unresolved source in frontmatter of ${page.file.path}: ${content.source}`, |
| 66 | + // ); |
| 67 | + // content = await sourcePage.data.load(); |
| 68 | + // } |
| 69 | + |
| 70 | + // const MdxContent = content.body; |
| 71 | + |
| 72 | + // return ( |
| 73 | + // <DocsPage toc={content.toc} full={content.full}> |
| 74 | + // <DocPageHeading repository={repository} includeDocsDescription={false} /> |
| 75 | + // <DocsBody> |
| 76 | + // <MdxContent |
| 77 | + // components={createMdxComponents({ |
| 78 | + // a: ({ href, ...props }: { href: string }) => { |
| 79 | + // return ( |
| 80 | + // <a |
| 81 | + // href={createRelativeLink(repository, version, href)} |
| 82 | + // {...props} |
| 83 | + // /> |
| 84 | + // ); |
| 85 | + // }, |
| 86 | + // })} |
| 87 | + // /> |
| 88 | + // </DocsBody> |
| 89 | + // </DocsPage> |
| 90 | + // ); |
89 | 91 | } |
90 | 92 |
|
91 | 93 | export async function generateMetadata({ params }: Props) { |
|
0 commit comments