feat: add robots and sitemap generation, enhance documentation page with copy markdown button

- Introduced `robots.ts` for defining robots.txt rules and sitemap URL.
- Added `sitemap.ts` to generate a sitemap based on available documentation pages.
- Enhanced the documentation page to include a "Copy as Markdown" button for easy copying of content.
- Created `copy-markdown-button.tsx` component for clipboard functionality.
- Implemented `llms.txt` route to provide a text-based overview of documentation links.
This commit is contained in:
Mauricio Siu
2026-04-07 17:39:15 -06:00
parent 37997ec7a4
commit 97cccc5445
5 changed files with 99 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
import { getPageImage, source } from "@/lib/source";
import { CopyMarkdownButton } from "@/components/copy-markdown-button";
import { getPageImage, getLLMText, source } from "@/lib/source";
import { getMDXComponents } from "@/mdx-components";
import {
DocsBody,
@@ -16,10 +17,14 @@ export default async function Page(props: PageProps<"/docs/[[...slug]]">) {
if (!page) notFound();
const MDX = page.data.body;
const markdown = await getLLMText(page);
return (
<DocsPage toc={page.data.toc} full={page.data.full}>
<DocsTitle>{page.data.title}</DocsTitle>
<div className="flex items-center justify-between">
<DocsTitle>{page.data.title}</DocsTitle>
<CopyMarkdownButton markdown={markdown} />
</div>
<DocsDescription>{page.data.description}</DocsDescription>
<DocsBody>
<MDX