From 652aa1652fc52aa0eda4682ee0db5be64b9807e1 Mon Sep 17 00:00:00 2001 From: Morgan Dean Date: Wed, 25 Jun 2025 12:00:33 -0700 Subject: [PATCH] modify generatemetadata, add prettierrc (since biome doesn't support mdx) --- docs/.prettierrc | 8 +++ docs/content/docs/v1/index.mdx | 4 +- docs/content/docs/v1/meta.json | 2 +- docs/src/app/(home)/[[...slug]]/page.tsx | 5 +- docs/src/app/(home)/layout.tsx | 62 ++++++++++++------------ 5 files changed, 46 insertions(+), 35 deletions(-) create mode 100644 docs/.prettierrc diff --git a/docs/.prettierrc b/docs/.prettierrc new file mode 100644 index 00000000..03af2a8b --- /dev/null +++ b/docs/.prettierrc @@ -0,0 +1,8 @@ +{ + "useTabs": false, + "semi": true, + "singleQuote": true, + "trailingComma": "es5", + "bracketSpacing": true, + "jsxBracketSameLine": true +} \ No newline at end of file diff --git a/docs/content/docs/v1/index.mdx b/docs/content/docs/v1/index.mdx index 5a100a6c..8d6a7868 100644 --- a/docs/content/docs/v1/index.mdx +++ b/docs/content/docs/v1/index.mdx @@ -1,6 +1,6 @@ --- -title: C/ua Documentation -description: C/ua Documentation +title: Home +description: c/ua Documentation Home --- ## What is C/ua? diff --git a/docs/content/docs/v1/meta.json b/docs/content/docs/v1/meta.json index d3fb1e75..66ebbf81 100644 --- a/docs/content/docs/v1/meta.json +++ b/docs/content/docs/v1/meta.json @@ -4,7 +4,7 @@ "root": true, "defaultOpen": true, "pages": [ - "---[House]C/ua---", + "---[House]c/ua---", "...cua", "---[Library]Libraries---", "...libraries", diff --git a/docs/src/app/(home)/[[...slug]]/page.tsx b/docs/src/app/(home)/[[...slug]]/page.tsx index 91d29d92..5c13f492 100644 --- a/docs/src/app/(home)/[[...slug]]/page.tsx +++ b/docs/src/app/(home)/[[...slug]]/page.tsx @@ -45,8 +45,11 @@ export async function generateMetadata(props: { const page = source.getPage(params.slug); if (!page) notFound(); + let title = `c/ua Docs: ${page.data.title}`; + if (page.url.includes('api')) title = `c/ua API: ${page.data.title}`; + return { - title: page.data.title, + title, description: page.data.description, }; } diff --git a/docs/src/app/(home)/layout.tsx b/docs/src/app/(home)/layout.tsx index 0b7fee10..2dc168a7 100644 --- a/docs/src/app/(home)/layout.tsx +++ b/docs/src/app/(home)/layout.tsx @@ -1,34 +1,34 @@ -import { DocsLayout } from "fumadocs-ui/layouts/docs"; -import type { ReactNode } from "react"; -import { baseOptions } from "@/app/layout.config"; -import { source } from "@/lib/source"; -import { CodeXml } from "lucide-react"; +import { DocsLayout } from 'fumadocs-ui/layouts/docs'; +import type { ReactNode } from 'react'; +import { baseOptions } from '@/app/layout.config'; +import { source } from '@/lib/source'; +import { CodeXml } from 'lucide-react'; export default function Layout({ children }: { children: ReactNode }) { - return ( - - - - }, - ], - }} - {...baseOptions} - > - {children} - - ); + return ( + + + + ), + }, + ], + }} + {...baseOptions}> + {children} + + ); }