cleanup imports
This commit is contained in:
parent
ec27cd9f29
commit
8d35e7ab0f
@ -2,7 +2,7 @@ import { CustomMDX } from "@/app/components/mdx-components";
|
||||
import { Metadata } from "next";
|
||||
import { generateEmbed } from "@/app/common/embed";
|
||||
import { Title } from "@/app/components/title";
|
||||
import { getDocContent, getDocsContent } from "@/app/common/documentation";
|
||||
import { DocsContentMetadata, getDocContent, getDocsContent } from "@/app/common/documentation";
|
||||
import {
|
||||
Breadcrumb,
|
||||
BreadcrumbItem,
|
||||
@ -13,7 +13,6 @@ import {
|
||||
import { capitalizeFirstLetter } from "@/app/common/string-utils";
|
||||
import { notFound } from "next/navigation";
|
||||
import { GithubLink } from "@/app/components/docs/github-link";
|
||||
import { cn } from "@/app/common/utils";
|
||||
|
||||
type DocumentationPageParams = {
|
||||
params: {
|
||||
@ -25,7 +24,7 @@ type DocumentationPageParams = {
|
||||
};
|
||||
|
||||
export async function generateStaticParams() {
|
||||
let documentationPages = getDocsContent();
|
||||
let documentationPages: DocsContentMetadata[] = getDocsContent();
|
||||
|
||||
return documentationPages.map(page => ({
|
||||
slug: [page.slug],
|
||||
@ -33,7 +32,7 @@ export async function generateStaticParams() {
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params: { slug } }: DocumentationPageParams): Promise<Metadata> {
|
||||
const page = getDocContent(slug);
|
||||
const page: DocsContentMetadata | undefined = getDocContent(slug);
|
||||
|
||||
// Fallback to page not found
|
||||
if (!page) {
|
||||
@ -50,15 +49,15 @@ export async function generateMetadata({ params: { slug } }: DocumentationPagePa
|
||||
}
|
||||
|
||||
export default function Page({ params: { slug } }: DocumentationPageParams) {
|
||||
const page = getDocContent(slug);
|
||||
const page: DocsContentMetadata | undefined = getDocContent(slug);
|
||||
|
||||
// Page was not found, show an error page
|
||||
if (!page) {
|
||||
return notFound();
|
||||
}
|
||||
|
||||
const slugParts = page.slug.split("/");
|
||||
const isHome = slugParts.length == 1;
|
||||
const slugParts: string[] = page.slug.split("/");
|
||||
const isHome: boolean = slugParts.length == 1;
|
||||
|
||||
return (
|
||||
<div className="w-full h-full px-4 flex flex-col gap-4">
|
||||
|
@ -1,5 +1,4 @@
|
||||
import React, { ReactElement } from "react";
|
||||
import { Search } from "@/app/components/docs/search";
|
||||
import { Sidebar } from "@/app/components/docs/sidebar";
|
||||
|
||||
export default function RootLayout({
|
||||
|
Loading…
x
Reference in New Issue
Block a user