From 3e4f4dd6d8a68e3c4c8cee868b143b1e65620e0d Mon Sep 17 00:00:00 2001 From: miloschwartz Date: Fri, 25 Sep 2026 16:04:43 -0400 Subject: [PATCH] fix open in github --- app/(docs)/[[...slug]]/page.tsx | 6 +++--- app/layout.tsx | 2 +- lib/shared.ts | 5 ++++- lib/source.ts | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/(docs)/[[...slug]]/page.tsx b/app/(docs)/[[...slug]]/page.tsx index 97c5956..f291d83 100644 --- a/app/(docs)/[[...slug]]/page.tsx +++ b/app/(docs)/[[...slug]]/page.tsx @@ -11,7 +11,7 @@ import { notFound } from 'next/navigation'; import { getMDXComponents } from '@/components/mdx'; import type { Metadata } from 'next'; import { createRelativeLink } from 'fumadocs-ui/mdx'; -import { getPageImageUrl, getPageMarkdownUrl, gitConfig, siteUrl } from '@/lib/shared'; +import { appName, docsDir, getPageImageUrl, getPageMarkdownUrl, gitConfig, siteUrl } from '@/lib/shared'; import { AskAIAboutPage } from '@/components/ai/ask-page'; import { SiteFooter } from '@/components/site-footer'; import { AskBar } from '@/components/ai/ask-bar'; @@ -46,7 +46,7 @@ export default async function Page(props: PageProps<'/[[...slug]]'>) { @@ -73,7 +73,7 @@ export async function generateMetadata(props: PageProps<'/[[...slug]]'>): Promis const isHome = page.slugs.length === 0; return { - title: isHome ? { absolute: `${page.data.title} - Pangolin Docs` } : page.data.title, + title: isHome ? { absolute: `${page.data.title} | ${appName}` } : page.data.title, description: page.data.description, alternates: { canonical: page.url, diff --git a/app/layout.tsx b/app/layout.tsx index e28c56e..bf135f0 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -12,7 +12,7 @@ const inter = Inter({ export const metadata: Metadata = { metadataBase: new URL(siteUrl), - title: { template: `%s - ${appName}`, default: appName }, + title: { template: `%s | ${appName}`, default: appName }, description: siteDescription, appleWebApp: { title: appName }, openGraph: { siteName: appName, images: '/images/home-social-graph.png' }, diff --git a/lib/shared.ts b/lib/shared.ts index a4759ae..0f9a655 100644 --- a/lib/shared.ts +++ b/lib/shared.ts @@ -12,10 +12,13 @@ export const docsContentRoute = '/llms.mdx'; export const gitConfig = { user: 'fosrl', - repo: 'docs-v2', + repo: 'docs', branch: 'main', }; +/** collection directory; `page.path` is relative to this */ +export const docsDir = 'content/docs'; + const getContentUrl = createGetUrl(docsContentRoute); export function getPageMarkdownUrl(page: { slugs: string[]; locale?: string }) { diff --git a/lib/source.ts b/lib/source.ts index 0c4844d..fabaaf2 100644 --- a/lib/source.ts +++ b/lib/source.ts @@ -1,5 +1,5 @@ import { llms, loader } from 'fumadocs-core/source'; -import { docsContentRoute, docsRoute } from './shared'; +import { docsContentRoute, docsDir, docsRoute } from './shared'; import { defineDocs } from 'fumadocs-mdx/macro'; import { applyMdxPreset } from 'fumadocs-mdx/config'; import { metaSchema, pageSchema } from 'fumadocs-core/source/schema'; @@ -7,7 +7,7 @@ import { transformerMetaHighlight } from '@shikijs/transformers'; import { rehypeCodeDefaultOptions } from 'fumadocs-core/mdx-plugins'; const docs = defineDocs({ - dir: 'content/docs', + dir: docsDir, docs: { schema: pageSchema, mdxOptions: applyMdxPreset({