mirror of
https://github.com/fosrl/docs-v2.git
synced 2026-10-01 18:29:09 +02:00
Merge branch 'dev'
This commit is contained in:
@@ -11,7 +11,7 @@ import { notFound } from 'next/navigation';
|
|||||||
import { getMDXComponents } from '@/components/mdx';
|
import { getMDXComponents } from '@/components/mdx';
|
||||||
import type { Metadata } from 'next';
|
import type { Metadata } from 'next';
|
||||||
import { createRelativeLink } from 'fumadocs-ui/mdx';
|
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 { AskAIAboutPage } from '@/components/ai/ask-page';
|
||||||
import { SiteFooter } from '@/components/site-footer';
|
import { SiteFooter } from '@/components/site-footer';
|
||||||
import { AskBar } from '@/components/ai/ask-bar';
|
import { AskBar } from '@/components/ai/ask-bar';
|
||||||
@@ -46,7 +46,7 @@ export default async function Page(props: PageProps<'/[[...slug]]'>) {
|
|||||||
<ViewOptionsPopover
|
<ViewOptionsPopover
|
||||||
markdownUrl={markdownUrl}
|
markdownUrl={markdownUrl}
|
||||||
pageUrl={`${siteUrl}${page.url}`}
|
pageUrl={`${siteUrl}${page.url}`}
|
||||||
githubUrl={`https://github.com/${gitConfig.user}/${gitConfig.repo}/blob/${gitConfig.branch}/${page.path}`}
|
githubUrl={`https://github.com/${gitConfig.user}/${gitConfig.repo}/blob/${gitConfig.branch}/${docsDir}/${page.path}`}
|
||||||
/>
|
/>
|
||||||
<AskAIAboutPage title={page.data.title} />
|
<AskAIAboutPage title={page.data.title} />
|
||||||
</div>
|
</div>
|
||||||
@@ -73,7 +73,7 @@ export async function generateMetadata(props: PageProps<'/[[...slug]]'>): Promis
|
|||||||
|
|
||||||
const isHome = page.slugs.length === 0;
|
const isHome = page.slugs.length === 0;
|
||||||
return {
|
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,
|
description: page.data.description,
|
||||||
alternates: {
|
alternates: {
|
||||||
canonical: page.url,
|
canonical: page.url,
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ const inter = Inter({
|
|||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
metadataBase: new URL(siteUrl),
|
metadataBase: new URL(siteUrl),
|
||||||
title: { template: `%s - ${appName}`, default: appName },
|
title: { template: `%s | ${appName}`, default: appName },
|
||||||
description: siteDescription,
|
description: siteDescription,
|
||||||
appleWebApp: { title: appName },
|
appleWebApp: { title: appName },
|
||||||
openGraph: { siteName: appName, images: '/images/home-social-graph.png' },
|
openGraph: { siteName: appName, images: '/images/home-social-graph.png' },
|
||||||
|
|||||||
+4
-1
@@ -12,10 +12,13 @@ export const docsContentRoute = '/llms.mdx';
|
|||||||
|
|
||||||
export const gitConfig = {
|
export const gitConfig = {
|
||||||
user: 'fosrl',
|
user: 'fosrl',
|
||||||
repo: 'docs-v2',
|
repo: 'docs',
|
||||||
branch: 'main',
|
branch: 'main',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** collection directory; `page.path` is relative to this */
|
||||||
|
export const docsDir = 'content/docs';
|
||||||
|
|
||||||
const getContentUrl = createGetUrl(docsContentRoute);
|
const getContentUrl = createGetUrl(docsContentRoute);
|
||||||
|
|
||||||
export function getPageMarkdownUrl(page: { slugs: string[]; locale?: string }) {
|
export function getPageMarkdownUrl(page: { slugs: string[]; locale?: string }) {
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import { llms, loader } from 'fumadocs-core/source';
|
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 { defineDocs } from 'fumadocs-mdx/macro';
|
||||||
import { applyMdxPreset } from 'fumadocs-mdx/config';
|
import { applyMdxPreset } from 'fumadocs-mdx/config';
|
||||||
import { metaSchema, pageSchema } from 'fumadocs-core/source/schema';
|
import { metaSchema, pageSchema } from 'fumadocs-core/source/schema';
|
||||||
@@ -7,7 +7,7 @@ import { transformerMetaHighlight } from '@shikijs/transformers';
|
|||||||
import { rehypeCodeDefaultOptions } from 'fumadocs-core/mdx-plugins';
|
import { rehypeCodeDefaultOptions } from 'fumadocs-core/mdx-plugins';
|
||||||
|
|
||||||
const docs = defineDocs({
|
const docs = defineDocs({
|
||||||
dir: 'content/docs',
|
dir: docsDir,
|
||||||
docs: {
|
docs: {
|
||||||
schema: pageSchema,
|
schema: pageSchema,
|
||||||
mdxOptions: applyMdxPreset({
|
mdxOptions: applyMdxPreset({
|
||||||
|
|||||||
Reference in New Issue
Block a user