Skip to content

Commit 1f120a7

Browse files
committed
fix(llms): correct URLs for GitHub Pages deployment
Fixed broken links in /llms.txt that resulted in 404 errors when deployed to GitHub Pages. Issues: - Paths missing /documents base path prefix - Links pointing to .md instead of /index.md for directories (e.g., /docs/.md instead of /docs/index.md) Changes: - Import and use basePath for GitHub Pages prefix (/documents) - Change doc links from ${path}.md to ${basePath}${path}index.md - Change API links from /api/${name}.md to ${basePath}/api/${name}/index.md This ensures all llms.txt links work correctly on GitHub Pages where: - Base URL is jsr-probitas.github.io/documents - Directory pages are served as /path/index.md not /path.md
1 parent 72e36fe commit 1f120a7

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

.claude/rules/architecture.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ documents/
1818

1919
## Routes
2020

21-
| Path | Description |
22-
| --------------------- | ------------------------ |
23-
| `/` | Landing page |
24-
| `/docs/{page}` | Documentation pages |
25-
| `/api/{package}` | API reference |
21+
| Path | Description |
22+
| ---------------- | ------------------- |
23+
| `/` | Landing page |
24+
| `/docs/{page}` | Documentation pages |
25+
| `/api/{package}` | API reference |
2626

2727
## API Generation
2828

.claude/rules/content.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ Every concept needs a runnable example:
1818
import { client, expect, scenario } from "jsr:@probitas/probitas";
1919

2020
export default scenario("Example")
21-
.resource("http", () =>
22-
client.http.createHttpClient({ url: "http://localhost:8080" }))
21+
.resource(
22+
"http",
23+
() => client.http.createHttpClient({ url: "http://localhost:8080" }),
24+
)
2325
.step("make request", async (ctx) => {
2426
const res = await ctx.resources.http.get("/api/users");
2527
expect(res).toBeOk().toHaveStatus(200);

lib/llms.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Implements the llms.txt standard: https://llmstxt.org/
55
*/
66

7-
import { docPages, siteMetadata } from "../data/docs.ts";
7+
import { basePath, docPages, siteMetadata } from "../data/docs.ts";
88
import { getPackageGroups, loadPackageDoc } from "../data/api-pages.ts";
99

1010
/**
@@ -47,7 +47,7 @@ export async function generateLlmsTxt(): Promise<string> {
4747
"## Documentation",
4848
"",
4949
...docPages.map((doc) =>
50-
`- [${doc.title}](${doc.path}.md): ${doc.description}`
50+
`- [${doc.title}](${basePath}${doc.path}index.md): ${doc.description}`
5151
),
5252
"",
5353
"## API Reference",
@@ -59,7 +59,9 @@ export async function generateLlmsTxt(): Promise<string> {
5959
lines.push(`### ${group.name}`, "");
6060
for (const pkg of group.packages) {
6161
const desc = await getPackageDescription(pkg.name);
62-
lines.push(`- [\`${pkg.specifier}\`](/api/${pkg.name}.md): ${desc}`);
62+
lines.push(
63+
`- [\`${pkg.specifier}\`](${basePath}/api/${pkg.name}/index.md): ${desc}`,
64+
);
6365
}
6466
lines.push("");
6567
}

0 commit comments

Comments
 (0)