Skip to content

Commit 6f3c180

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

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

data/docs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const siteMetadata = {
8181
"Probitas is a scenario-based testing framework for Deno that enables declarative, readable integration tests for APIs, databases, message queues, and other backend services.",
8282
github: "https://github.com/jsr-probitas/probitas",
8383
jsr: "https://jsr.io/@probitas/probitas",
84-
baseUrl: "https://jsr-probitas.github.io/documents",
84+
baseUrl: Deno.env.get("BASE_URL") ?? "https://jsr-probitas.github.io/documents",
8585
};
8686

8787
/**

lib/api-markdown.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
formatMethodSignature,
3535
formatTypeAliasSignature,
3636
} from "./signature-formatters.ts";
37+
import { siteMetadata } from "../data/docs.ts";
3738

3839
// ============================================================================
3940
// Type Reference Collector
@@ -61,7 +62,7 @@ class TypeReferenceCollector {
6162
localTypes: Set<string>,
6263
typeToPackage: Map<string, string>,
6364
currentPackage: string,
64-
baseUrl = "https://jsr-probitas.github.io/documents",
65+
baseUrl = siteMetadata.baseUrl,
6566
) {
6667
this.localTypes = localTypes;
6768
this.typeToPackage = typeToPackage;
@@ -525,7 +526,7 @@ export function generateApiMarkdown(
525526
const lines: string[] = [];
526527
const {
527528
allPackages = [],
528-
baseUrl = "https://jsr-probitas.github.io/documents",
529+
baseUrl = siteMetadata.baseUrl,
529530
updatedAt,
530531
} = options;
531532

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)