Skip to content

feat: add llms-txt to the url #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions apps/web/actions/submit-llms-xxt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,29 @@ const owner = 'thedaviddias'
const repo = 'llms-txt-hub'

/**
* Submits a new LLMs entry via GitHub PR
* Submits a new LLMs entry by creating a pull request with an MDX file
*
* @param formData - Form data containing the entry details
* @param formData.name - Name of the website/project
* @param formData.description - Description of the website/project
* @param formData.website - URL of the website
* @param formData.llmsUrl - URL of the llms.txt file
* @param formData.llmsFullUrl - Optional URL of the llms-full.txt file
* @param formData.category - Category slug for the website
* @param formData.publishedAt - Publication date
*
* @returns Object containing success status and PR URL or error message
* @throws Error if authentication fails or required fields are missing
*
* @example
* ```ts
* const result = await submitLlmsTxt(formData);
* if (result.success) {
* console.log('PR created:', result.prUrl);
* } else {
* console.error('Error:', result.error);
* }
* ```
*/
export async function submitLlmsTxt(formData: FormData) {
try {
Expand Down Expand Up @@ -151,7 +170,7 @@ ${description}

// Create a new branch in the fork
const branchName = `submit-${name.toLowerCase().replace(/\s+/g, '-')}-${Date.now()}`
const filePath = `content/websites/${name.toLowerCase().replace(/\s+/g, '-')}.mdx`
const filePath = `content/websites/${name.toLowerCase().replace(/\s+/g, '-')}-llms-txt.mdx`

// Get the reference from the original repo
const mainRef = await octokit.git
Expand Down
6 changes: 6 additions & 0 deletions apps/web/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ let nextConfig: NextConfig = {
source: '/website/:path*',
destination: '/websites/:path*',
permanent: true
},
{
// Redirect old website URLs to new ones with -llms-txt suffix
source: '/websites/:slug((?!.*-llms-txt).*)',
destination: '/websites/:slug-llms-txt',
permanent: true
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions content/guides/getting-started-llms-txt.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ Several tools can help you generate llms.txt files:

Many organizations have already adopted the llms.txt proposed standard:

- [Cloudflare](https://llmstxthub.com/websites/cloudflare): Impressive and extensive documentation about all the Cloudflare services
- [Anthropic's llms.txt](https://llmstxthub.com/websites/anthropic): All their documentation and prompt library
- [Cloudflare](https://llmstxthub.com/websites/cloudflare-llms-txt): Impressive and extensive documentation about all the Cloudflare services
- [Anthropic's llms.txt](https://llmstxthub.com/websites/anthropic-llms-txt): All their documentation and prompt library
- [Perplexity's llms-full.txt](https://llmstxthub.com/website/perplexity): A comprehensive implementation all their documentation and content website
- [ElevenLabs](https://llmstxthub.com/websites/elevenlabs): All the documenation about their API and product guides
- [ElevenLabs](https://llmstxthub.com/websites/elevenlabs-llms-txt): All the documenation about their API and product guides


## Best Practices
Expand Down
12 changes: 6 additions & 6 deletions content/guides/llmstxt-guide-next-project.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ llms.txt hub website homepage displaying featured websites, website count, and g
llmstxthub.com is the largest directory of websites offering llms.txt
Here are some fantastic options already on board:

- [Supabase](https://llmstxthub.com/websites/supabase) — The open-source Firebase alternative
- [Turbo](https://llmstxthub.com/websites/turbo) — Incremental bundler and build system
- [Prisma](https://llmstxthub.com/websites/prisma) — Next-generation ORM for Node.js and TypeScript
- [Drizzle](https://llmstxthub.com/websites/drizzle-orm) — Headless TypeScript ORM that runs everywhere from Node to the Edge
- [Cloudflare](https://llmstxthub.com/websites/cloudflare) — Security and performance at the edge
- [Better Auth](https://llmstxthub.com/websites/better-auth) — Comprehensive authentication library for TypeScript
- [Supabase](https://llmstxthub.com/websites/supabase-llms-txt) — The open-source Firebase alternative
- [Turbo](https://llmstxthub.com/websites/turbo-llms-txt) — Incremental bundler and build system
- [Prisma](https://llmstxthub.com/websites/prisma-llms-txt) — Next-generation ORM for Node.js and TypeScript
- [Drizzle](https://llmstxthub.com/websites/drizzle-orm-llms-txt) — Headless TypeScript ORM that runs everywhere from Node to the Edge
- [Cloudflare](https://llmstxthub.com/websites/cloudflare-llms-txt) — Security and performance at the edge
- [Better Auth](https://llmstxthub.com/websites/better-auth-llms-txt) — Comprehensive authentication library for TypeScript

Plus dozens more across categories like:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Embla Carousel
description: >-
A lightweight and extensible carousel library with fluid motion and great swipe precision. Supports React, Vue, Svelte, and vanilla JavaScript.
website: 'https://www.embla-carousel.com'
llmsUrl: '/websites/embla-carousel/llms.txt'
llmsFullUrl: '/websites/embla-carousel/llms-full.txt'
llmsUrl: '/websites/embla-carousel-llms-txt/llms.txt'
llmsFullUrl: '/websites/embla-carousel-llms-txt/llms-full.txt'
category: developer-tools
publishedAt: '2025-03-08'
---
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion turbo/generators/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default function generator(plop: PlopTypes.NodePlopAPI): void {
actions: [
{
type: 'add',
path: 'content/websites/{{dashCase name}}.mdx',
path: 'content/websites/{{dashCase name}}-llms-txt.mdx',
templateFile: 'templates/mdx.hbs'
}
]
Expand Down
Loading