Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions app/(docs)/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import { getPageImageUrl, getPageMarkdownUrl, source } from '@/lib/source';
import { getPageImageUrl, source } from '@/lib/source';
import {
DocsBody,
DocsDescription,
DocsPage,
DocsTitle,
MarkdownCopyButton,
ViewOptionsPopover,
} from 'fumadocs-ui/layouts/docs/page';
import { notFound } from 'next/navigation';
import { getMDXComponents } from '@/components/mdx';
import type { Metadata } from 'next';
import { createRelativeLink } from '@/lib/relative-link';
import { gitConfig } from '@/lib/shared';

// Routes carry the .html suffix of the legacy Read the Docs URLs
// (/howto/select.html); page slugs in the source do not.
Expand All @@ -28,24 +25,11 @@ export default async function Page(props: PageProps<'/[[...slug]]'>) {
if (!page) notFound();

const MDX = page.data.body;
const markdownUrl = getPageMarkdownUrl(page).url;
// Per-release changelog pages are split out of reference/changelog.md by
// the ingest step; their upstream source is that one file.
const sourcePath = page.path.startsWith('reference/changelog/')
? 'reference/changelog.md'
: page.path;

return (
<DocsPage toc={page.data.toc} full={page.data.full}>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsDescription className="mb-0">{page.data.description}</DocsDescription>
<div className="flex flex-row gap-2 items-center border-b pb-6">
<MarkdownCopyButton markdownUrl={markdownUrl} />
<ViewOptionsPopover
markdownUrl={markdownUrl}
githubUrl={`https://github.com/${gitConfig.user}/${gitConfig.repo}/blob/${gitConfig.branch}/docs/${sourcePath}`}
/>
</div>
<DocsDescription>{page.data.description}</DocsDescription>
<DocsBody>
<MDX
components={getMDXComponents({
Expand Down
Loading