mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
fix(web): remove LLM page actions and related routes
This commit is contained in:
@@ -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: {
|
||||
@@ -23,13 +22,6 @@ export default async function Page(props: {
|
||||
<DocsPage toc={page.data.toc} full={page.data.full}>
|
||||
<DocsTitle>{page.data.title}</DocsTitle>
|
||||
<DocsDescription>{page.data.description}</DocsDescription>
|
||||
<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>
|
||||
<DocsBody>
|
||||
<MDX components={{ ...defaultMdxComponents, ...TabsComponents }} />
|
||||
</DocsBody>
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
import { Banner } from "fumadocs-ui/components/banner";
|
||||
import { DocsLayout } from "fumadocs-ui/layouts/docs";
|
||||
import { DocsLayout, type DocsLayoutProps } from "fumadocs-ui/layouts/docs";
|
||||
import type { ReactNode } from "react";
|
||||
import { baseOptions } from "@/app/layout.config";
|
||||
import { baseOptions, links } from "@/app/layout.config";
|
||||
import { source } from "@/lib/source";
|
||||
|
||||
const docsOptions: DocsLayoutProps = {
|
||||
...baseOptions,
|
||||
tree: source.pageTree,
|
||||
links: links.filter((link) => "text" in link && link.text !== "Docs"),
|
||||
};
|
||||
|
||||
export default function Layout({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<>
|
||||
<Banner variant="rainbow">
|
||||
⚠️ WORK IN PROGRESS DONT TAKE REFERENCE!!!
|
||||
</Banner>
|
||||
<DocsLayout tree={source.pageTree} {...baseOptions}>
|
||||
{children}
|
||||
</DocsLayout>
|
||||
<DocsLayout {...docsOptions}>{children}</DocsLayout>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
|
||||
import type { BaseLayoutProps, LinkItemType } from "fumadocs-ui/layouts/shared";
|
||||
import Image from "next/image";
|
||||
import discordLogo from "@/public/icon/discord.svg";
|
||||
import npmLogo from "@/public/icon/npm.svg";
|
||||
@@ -16,6 +16,61 @@ export const logo = (
|
||||
</>
|
||||
);
|
||||
|
||||
export const links: LinkItemType[] = [
|
||||
{
|
||||
text: "Docs",
|
||||
url: "/docs",
|
||||
active: "nested-url" as const,
|
||||
},
|
||||
{
|
||||
text: "Builder",
|
||||
url: "/new",
|
||||
},
|
||||
{
|
||||
text: "Analytics",
|
||||
url: "/analytics",
|
||||
},
|
||||
{
|
||||
text: "Showcase",
|
||||
url: "/showcase",
|
||||
},
|
||||
{
|
||||
text: "NPM",
|
||||
icon: (
|
||||
<Image src={npmLogo} alt="npm" className="size-4 invert-0 dark:invert" />
|
||||
),
|
||||
label: "NPM",
|
||||
type: "icon",
|
||||
url: "https://www.npmjs.com/package/create-better-t-stack",
|
||||
external: true,
|
||||
secondary: true,
|
||||
},
|
||||
{
|
||||
text: "X",
|
||||
icon: <Image src={xLogo} alt="x" className="size-4 invert dark:invert-0" />,
|
||||
label: "X",
|
||||
type: "icon",
|
||||
url: "https://x.com/amanvarshney01",
|
||||
external: true,
|
||||
secondary: true,
|
||||
},
|
||||
{
|
||||
text: "Discord",
|
||||
icon: (
|
||||
<Image
|
||||
src={discordLogo}
|
||||
alt="discord"
|
||||
className="size-5 invert-0 dark:invert"
|
||||
/>
|
||||
),
|
||||
label: "Discord",
|
||||
type: "icon",
|
||||
url: "https://discord.gg/ZYsbjpDaM5",
|
||||
external: true,
|
||||
secondary: true,
|
||||
},
|
||||
];
|
||||
|
||||
export const baseOptions: BaseLayoutProps = {
|
||||
nav: {
|
||||
title: (
|
||||
@@ -26,66 +81,7 @@ export const baseOptions: BaseLayoutProps = {
|
||||
</span>
|
||||
</>
|
||||
),
|
||||
// enabled: false,
|
||||
},
|
||||
links: [
|
||||
{
|
||||
text: "Docs",
|
||||
url: "/docs",
|
||||
},
|
||||
{
|
||||
text: "Builder",
|
||||
url: "/new",
|
||||
},
|
||||
{
|
||||
text: "Analytics",
|
||||
url: "/analytics",
|
||||
},
|
||||
{
|
||||
text: "Showcase",
|
||||
url: "/showcase",
|
||||
},
|
||||
{
|
||||
text: "NPM",
|
||||
icon: (
|
||||
<Image
|
||||
src={npmLogo}
|
||||
alt="npm"
|
||||
className="size-4 invert-0 dark:invert"
|
||||
/>
|
||||
),
|
||||
label: "NPM",
|
||||
type: "icon",
|
||||
url: "https://www.npmjs.com/package/create-better-t-stack",
|
||||
external: true,
|
||||
secondary: true,
|
||||
},
|
||||
{
|
||||
text: "X",
|
||||
icon: (
|
||||
<Image src={xLogo} alt="x" className="size-4 invert dark:invert-0" />
|
||||
),
|
||||
label: "X",
|
||||
type: "icon",
|
||||
url: "https://x.com/amanvarshney01",
|
||||
external: true,
|
||||
secondary: true,
|
||||
},
|
||||
{
|
||||
text: "Discord",
|
||||
icon: (
|
||||
<Image
|
||||
src={discordLogo}
|
||||
alt="discord"
|
||||
className="size-5 invert-0 dark:invert"
|
||||
/>
|
||||
),
|
||||
label: "Discord",
|
||||
type: "icon",
|
||||
url: "https://discord.gg/ZYsbjpDaM5",
|
||||
external: true,
|
||||
secondary: true,
|
||||
},
|
||||
],
|
||||
links: links,
|
||||
githubUrl: "https://github.com/AmanVarshney01/create-better-t-stack",
|
||||
};
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import { getLLMText } from "@/lib/get-llm-text";
|
||||
import { source } from "@/lib/source";
|
||||
|
||||
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"));
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user