test: switch to cloudflare

This commit is contained in:
Aman Varshney
2025-08-04 01:44:06 +05:30
parent f56a3b7338
commit 37e4e9ae43
18 changed files with 1881 additions and 350 deletions

View File

@@ -1,25 +0,0 @@
import { generateOGImage } from "fumadocs-ui/og";
import { notFound } from "next/navigation";
import { source } from "@/lib/source";
export async function GET(
_req: Request,
{ params }: { params: Promise<{ slug: string[] }> },
) {
const { slug } = await params;
const page = source.getPage(slug.slice(0, -1));
if (!page) notFound();
return generateOGImage({
title: page.data.title,
description: page.data.description,
site: "Better T Stack",
});
}
export function generateStaticParams() {
return source.generateParams().map((page) => ({
...page,
slug: [...page.slug, "image.png"],
}));
}

View File

@@ -7,7 +7,6 @@ import {
DocsTitle,
} from "fumadocs-ui/page";
import { notFound } from "next/navigation";
import { LLMCopyButton, ViewOptions } from "@/components/ai/page-actions";
import { source } from "@/lib/source";
export default async function Page(props: {
@@ -21,13 +20,6 @@ export default async function Page(props: {
return (
<DocsPage toc={page.data.toc} full={page.data.full}>
<div className="flex flex-row items-center gap-2 border-b pt-2 pb-6">
<LLMCopyButton markdownUrl={`${page.url}.mdx`} />
<ViewOptions
markdownUrl={`${page.url}.mdx`}
githubUrl={`https://github.com/amanvarshney01/create-better-t-stack/blob/dev/apps/docs/content/docs/${page.path}`}
/>
</div>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsDescription>{page.data.description}</DocsDescription>
<DocsBody>
@@ -49,16 +41,8 @@ export async function generateMetadata({
const { slug = [] } = await params;
const page = source.getPage(slug);
if (!page) notFound();
const image = ["/docs-og", ...slug, "image.png"].join("/");
return {
title: page.data.title,
description: page.data.description,
openGraph: {
images: image,
},
twitter: {
card: "summary_large_image",
images: image,
},
};
}

View File

@@ -1,12 +0,0 @@
import { getLLMText } from "@/lib/get-llm-text";
import { source } from "@/lib/source";
// cached forever
export const revalidate = false;
export async function GET() {
const scan = source.getPages().map(getLLMText);
const scanned = await Promise.all(scan);
return new Response(scanned.join("\n\n"));
}

View File

@@ -1,21 +0,0 @@
import { notFound } from "next/navigation";
import { type NextRequest, NextResponse } from "next/server";
import { getLLMText } from "@/lib/get-llm-text";
import { source } from "@/lib/source";
export const revalidate = false;
export async function GET(
_req: NextRequest,
{ params }: { params: Promise<{ slug?: string[] }> },
) {
const { slug } = await params;
const page = source.getPage(slug);
if (!page) notFound();
return new NextResponse(await getLLMText(page));
}
export function generateStaticParams() {
return source.generateParams();
}

View File

@@ -1,7 +1,7 @@
export const dynamic = "force-static";
import type { MetadataRoute } from "next";
export const dynamic = "force-static";
export default function manifest(): MetadataRoute.Manifest {
return {
name: "Better T Stack",

View File

@@ -1,14 +0,0 @@
export const dynamic = "force-static";
import type { MetadataRoute } from "next";
export default function robots(): MetadataRoute.Robots {
return {
rules: {
userAgent: "*",
allow: "/",
disallow: "/private/",
},
sitemap: "https://better-t-stack.dev/sitemap.xml",
};
}