mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-05-30 14:37:35 +08:00
fix: 后端代码格式化
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
import { source } from '@/lib/source';
|
||||
import { DocsBody, DocsDescription, DocsPage, DocsTitle } from 'fumadocs-ui/page';
|
||||
import type { Metadata } from 'next';
|
||||
import { notFound } from 'next/navigation';
|
||||
import { createRelativeLink } from 'fumadocs-ui/mdx';
|
||||
import { getMDXComponents } from '@/mdx-components';
|
||||
import { Card, Cards } from 'fumadocs-ui/components/card';
|
||||
import { getPageTreePeers } from 'fumadocs-core/server';
|
||||
import { source } from "@/lib/source";
|
||||
import {
|
||||
DocsBody,
|
||||
DocsDescription,
|
||||
DocsPage,
|
||||
DocsTitle,
|
||||
} from "fumadocs-ui/page";
|
||||
import type { Metadata } from "next";
|
||||
import { notFound } from "next/navigation";
|
||||
import { createRelativeLink } from "fumadocs-ui/mdx";
|
||||
import { getMDXComponents } from "@/mdx-components";
|
||||
import { Card, Cards } from "fumadocs-ui/components/card";
|
||||
import { getPageTreePeers } from "fumadocs-core/server";
|
||||
|
||||
function DocsCategory({ url }: { url: string }) {
|
||||
return (
|
||||
@@ -19,7 +24,7 @@ function DocsCategory({ url }: { url: string }) {
|
||||
);
|
||||
}
|
||||
|
||||
export default async function Page(props: PageProps<'/[[...slug]]'>) {
|
||||
export default async function Page(props: PageProps<"/[[...slug]]">) {
|
||||
const params = await props.params;
|
||||
const page = source.getPage(params.slug);
|
||||
if (!page) notFound();
|
||||
@@ -48,7 +53,7 @@ export async function generateStaticParams() {
|
||||
}
|
||||
|
||||
export async function generateMetadata(
|
||||
props: PageProps<'/[[...slug]]'>
|
||||
props: PageProps<"/[[...slug]]">,
|
||||
): Promise<Metadata> {
|
||||
const params = await props.params;
|
||||
const page = source.getPage(params.slug);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
|
||||
import { baseOptions } from '@/lib/layout.shared';
|
||||
import { source } from '@/lib/source';
|
||||
import { CodeXmlIcon, CompassIcon, ServerIcon } from 'lucide-react';
|
||||
import { DocsLayout } from "fumadocs-ui/layouts/docs";
|
||||
import { baseOptions } from "@/lib/layout.shared";
|
||||
import { source } from "@/lib/source";
|
||||
import { CodeXmlIcon, CompassIcon, ServerIcon } from "lucide-react";
|
||||
|
||||
function TabIcon({
|
||||
color = 'var(--color-fd-foreground)',
|
||||
color = "var(--color-fd-foreground)",
|
||||
children,
|
||||
}: {
|
||||
color?: string;
|
||||
@@ -15,7 +15,7 @@ function TabIcon({
|
||||
className="[&_svg]:size-full rounded-lg size-full text-(--tab-color) max-md:bg-(--tab-color)/10 max-md:border max-md:p-1.5"
|
||||
style={
|
||||
{
|
||||
'--tab-color': color,
|
||||
"--tab-color": color,
|
||||
} as React.CSSProperties
|
||||
}
|
||||
>
|
||||
@@ -28,7 +28,7 @@ function TabTitle({ children }: { children: React.ReactNode }) {
|
||||
return <span className="text-[11px]">{children}</span>;
|
||||
}
|
||||
|
||||
export default function Layout({ children }: LayoutProps<'/'>) {
|
||||
export default function Layout({ children }: LayoutProps<"/">) {
|
||||
return (
|
||||
// @ts-ignore
|
||||
<DocsLayout
|
||||
@@ -38,9 +38,9 @@ export default function Layout({ children }: LayoutProps<'/'>) {
|
||||
prefetch: true,
|
||||
tabs: [
|
||||
{
|
||||
title: 'OpenIsle 前端',
|
||||
title: "OpenIsle 前端",
|
||||
description: <TabTitle>前端开发文档</TabTitle>,
|
||||
url: '/frontend',
|
||||
url: "/frontend",
|
||||
icon: (
|
||||
<TabIcon color="#4ca154">
|
||||
<CompassIcon />
|
||||
@@ -48,9 +48,9 @@ export default function Layout({ children }: LayoutProps<'/'>) {
|
||||
),
|
||||
},
|
||||
{
|
||||
title: 'OpenIsle 后端',
|
||||
title: "OpenIsle 后端",
|
||||
description: <TabTitle>后端开发文档</TabTitle>,
|
||||
url: '/backend',
|
||||
url: "/backend",
|
||||
icon: (
|
||||
<TabIcon color="#1f66f4">
|
||||
<ServerIcon />
|
||||
@@ -58,9 +58,9 @@ export default function Layout({ children }: LayoutProps<'/'>) {
|
||||
),
|
||||
},
|
||||
{
|
||||
title: 'OpenIsle API',
|
||||
title: "OpenIsle API",
|
||||
description: <TabTitle>后端 API 文档</TabTitle>,
|
||||
url: '/openapi',
|
||||
url: "/openapi",
|
||||
icon: (
|
||||
<TabIcon color="#677489">
|
||||
<CodeXmlIcon />
|
||||
|
||||
Reference in New Issue
Block a user