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

@@ -0,0 +1,30 @@
"use client";
import { useCopyButton } from "fumadocs-ui/utils/use-copy-button";
import { Check, Copy } from "lucide-react";
export function CopyMarkdownButton({ markdown }: { markdown: string }) {
const [checked, onClick] = useCopyButton(() => {
navigator.clipboard.writeText(markdown);
});
return (
<button
type="button"
className="inline-flex items-center gap-1.5 rounded-md border bg-fd-secondary px-3 py-1.5 text-xs font-medium text-fd-secondary-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground"
onClick={onClick}
>
{checked ? (
<>
<Check className="size-3.5" />
Copied!
</>
) : (
<>
<Copy className="size-3.5" />
Copy as Markdown
</>
)}
</button>
);
}