mirror of
https://github.com/Dokploy/website
synced 2025-06-26 18:16:01 +00:00
feat: update docs website
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
import { baseOptions } from "@/app/layout.config";
|
||||
import { HomeLayout } from "fumadocs-ui/layouts/home";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
export default function Layout({
|
||||
children,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
}): React.ReactElement {
|
||||
return <HomeLayout {...baseOptions}>{children}</HomeLayout>;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
import Link from "next/link";
|
||||
|
||||
export default function HomePage() {
|
||||
return (
|
||||
<main className="flex flex-1 flex-col justify-center text-center">
|
||||
<h1 className="mb-4 text-2xl font-bold">Hello World</h1>
|
||||
<p className="text-fd-muted-foreground">
|
||||
You can open{" "}
|
||||
<Link
|
||||
href="/docs"
|
||||
className="text-fd-foreground font-semibold underline"
|
||||
>
|
||||
/docs
|
||||
</Link>{" "}
|
||||
and see the documentation.
|
||||
</p>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -8,14 +8,16 @@ import {
|
||||
DocsPage,
|
||||
DocsTitle,
|
||||
} from "fumadocs-ui/page";
|
||||
import { notFound } from "next/navigation";
|
||||
import { notFound, permanentRedirect } from "next/navigation";
|
||||
|
||||
export default async function Page(props: {
|
||||
params: Promise<{ slug?: string[] }>;
|
||||
}) {
|
||||
const params = await props.params;
|
||||
const page = source.getPage(params.slug);
|
||||
if (!page) notFound();
|
||||
if (!page) {
|
||||
permanentRedirect("/docs/core");
|
||||
}
|
||||
|
||||
const MDX = page.data.body;
|
||||
|
||||
|
||||
@@ -7,7 +7,10 @@ const inter = Inter({
|
||||
subsets: ["latin"],
|
||||
});
|
||||
|
||||
export default function Layout({ children }: { children: ReactNode }) {
|
||||
export default async function Layout({
|
||||
children,
|
||||
...rest
|
||||
}: { children: ReactNode }) {
|
||||
return (
|
||||
<html lang="en" className={inter.className} suppressHydrationWarning>
|
||||
<body className="flex flex-col min-h-screen">
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
import { source } from "@/lib/source";
|
||||
import { url } from "@/utils/metadata";
|
||||
import type { MetadataRoute } from "next";
|
||||
// import { getPages } from "./source.config";
|
||||
|
||||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||
return [
|
||||
// ...docs().map<MetadataRoute.Sitemap[number]>((page) => {
|
||||
// return {
|
||||
// url: url(`/en${page.url}`),
|
||||
// lastModified: page.data.exports.lastModified
|
||||
// ? new Date(page.data.exports.lastModified)
|
||||
// : undefined,
|
||||
// changeFrequency: "weekly",
|
||||
// priority: page.url === "/docs/core/get-started/introduction" ? 1 : 0.8,
|
||||
// };
|
||||
// }),
|
||||
...(await Promise.all(
|
||||
source.getPages().map(async (page) => {
|
||||
const { lastModified } = page.data;
|
||||
return {
|
||||
url: url(page.url),
|
||||
lastModified: lastModified ? new Date(lastModified) : undefined,
|
||||
changeFrequency: "weekly",
|
||||
priority: 0.5,
|
||||
} as MetadataRoute.Sitemap[number];
|
||||
}),
|
||||
)),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user