feat(web): llms.txt, convex live stats, switch to vercel and improved ui (#460)

This commit is contained in:
Aman Varshney
2025-08-03 02:42:15 +05:30
committed by GitHub
parent 004cc01a0c
commit fef7f6b5e2
38 changed files with 2352 additions and 2676 deletions

View File

@@ -0,0 +1,26 @@
import type { InferPageType } from "fumadocs-core/source";
import { remarkInclude } from "fumadocs-mdx/config";
import { remark } from "remark";
import remarkGfm from "remark-gfm";
import remarkMdx from "remark-mdx";
import type { source } from "@/lib/source";
const processor = remark()
.use(remarkMdx)
// needed for Fumadocs MDX
.use(remarkInclude)
.use(remarkGfm);
export async function getLLMText(page: InferPageType<typeof source>) {
const processed = await processor.process({
path: page.data._file.absolutePath,
value: page.data.content,
});
return `# ${page.data.title}
URL: ${page.url}
${page.data.description}
${processed.value}`;
}

View File

@@ -0,0 +1,66 @@
export interface CustomSearchItem {
title: string;
url: string;
content: string;
tags: string[];
}
export const customSearchItems: CustomSearchItem[] = [
{
title: "Analytics",
url: "/analytics",
content: "Analytics",
tags: ["analytics", "insights", "statistics", "data", "metrics"],
},
{
title: "Showcase",
url: "/showcase",
content: "Showcase",
tags: ["showcase", "projects", "examples", "demos", "portfolio"],
},
{
title: "Builder",
url: "/new",
content: "Builder",
tags: ["builder", "create", "new", "project", "setup"],
},
{
title: "GitHub Repository",
url: "https://github.com/AmanVarshney01/create-better-t-stack",
content: "GitHub",
tags: ["github", "source", "code", "repository", "contribute", "star"],
},
{
title: "NPM Package",
url: "https://www.npmjs.com/package/create-better-t-stack",
content: "NPM",
tags: ["npm", "package", "install", "cli", "tool"],
},
{
title: "X (Twitter)",
url: "https://x.com/amanvarshney01",
content: "X",
tags: ["twitter", "x", "social", "updates", "announcements", "follow"],
},
{
title: "Discord Community",
url: "https://discord.gg/ZYsbjpDaM5",
content: "Discord",
tags: ["discord", "community", "chat", "help", "support", "discussions"],
},
];
export function filterCustomItems(
items: CustomSearchItem[],
searchQuery: string,
): CustomSearchItem[] {
if (!searchQuery) return items;
const searchLower = searchQuery.toLowerCase();
return items.filter(
(item) =>
item.title.toLowerCase().includes(searchLower) ||
item.content.toLowerCase().includes(searchLower) ||
item.tags.some((tag) => tag.toLowerCase().includes(searchLower)),
);
}