Skip to content

Commit 3cc7ee6

Browse files
committed
fix: llms links
1 parent 6388d1f commit 3cc7ee6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/llms.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ async function getPackageDescription(packageName: string): Promise<string> {
3939
export async function generateLlmsTxt(): Promise<string> {
4040
const groups = await getPackageGroups();
4141

42+
const resolveDocMarkdownPath = (path: string): string =>
43+
path.endsWith("/") ? `${path}index.md` : `${path}.md`;
44+
4245
const lines: string[] = [
4346
`# ${siteMetadata.name}`,
4447
"",
@@ -47,7 +50,7 @@ export async function generateLlmsTxt(): Promise<string> {
4750
"## Documentation",
4851
"",
4952
...docPages.map((doc) =>
50-
`- [${doc.title}](${basePath}${doc.path}index.md): ${doc.description}`
53+
`- [${doc.title}](${basePath}${resolveDocMarkdownPath(doc.path)}): ${doc.description}`
5154
),
5255
"",
5356
"## API Reference",

0 commit comments

Comments
 (0)