Skip to content

Commit d8367b4

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

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/llms.ts

Lines changed: 6 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,9 @@ 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}${
54+
resolveDocMarkdownPath(doc.path)
55+
}): ${doc.description}`
5156
),
5257
"",
5358
"## API Reference",

0 commit comments

Comments
 (0)