Skip to content

Commit a75b516

Browse files
authored
Fixing links per #39 (#71)
I think this fixes a ton of: jjasghar/link-verifier-llm-d.ai#6 Signed-off-by: JJ Asghar <[email protected]>
1 parent 45b6cab commit a75b516

File tree

3 files changed

+56
-26
lines changed

3 files changed

+56
-26
lines changed

remote-content/remote-sources/guide-inference-scheduling.js

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Guide Inference Scheduling Remote Content
3-
*
3+
*
44
* Downloads the inference scheduling README.md file from the llm-d-infra repository
55
* and transforms it into docs/guide/Installation/inference-scheduling.md
66
*/
@@ -15,11 +15,11 @@ export default [
1515
sourceBaseUrl: 'https://raw.githubusercontent.com/llm-d-incubation/llm-d-infra/main/',
1616
outDir: 'docs/guide/Installation',
1717
documents: ['quickstart/examples/inference-scheduling/README.md'],
18-
18+
1919
// Plugin behavior
2020
noRuntimeDownloads: false, // Download automatically when building
2121
performCleanup: true, // Clean up files after build
22-
22+
2323
// Transform the content for this specific document
2424
modifyContent(filename, content) {
2525
if (filename === 'quickstart/examples/inference-scheduling/README.md') {
@@ -35,24 +35,40 @@ export default [
3535
content,
3636
// Transform content to work in docusaurus context
3737
contentTransform: (content) => content
38-
// Fix relative links
39-
.replace(/\]\(\.\.\//g, '](../../')
40-
.replace(/\]\(\.\//g, '](')
4138
// Fix MDX compilation issues with angle bracket URLs
4239
.replace(/<(http[s]?:\/\/[^>]+)>/g, '`$1`')
43-
// Fix specific broken links to point to repository
40+
41+
// CRITICAL: Fix istio-workaround.md FIRST before any other URL transformations
42+
.replace(/\]\([^)]*istio-workaround\.md\)/g, '](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/istio-workaround.md)')
43+
44+
// Fix specific problematic links first (before general patterns)
45+
.replace(/\[install\-deps\.sh\]\(\.\.\/\.\.\/install\-deps\.sh\)/g, '[install-deps.sh](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/install-deps.sh)')
4446
.replace(/\[gke\.md\]\(gke\.md\)/g, '[gke.md](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/examples/inference-scheduling/gke.md)')
45-
.replace(/\[Temporary Istio Workaround\]\(\.\.\/\.\.\/\.\.\/istio-workaround\.md\)/g, '[Temporary Istio Workaround](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/istio-workaround.md)')
47+
.replace(/\[gke\.md\]\(\.\/gke\.md\)/g, '[gke.md](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/examples/inference-scheduling/gke.md)')
48+
.replace(/\[scheduling configuration\]\(https\:\/\/github\.com\/llm\-d\/llm\-d\-inference\-scheduler\/blob\/main\/docs\/architecture\.md\)/g, '[scheduling configuration](https://github.com/llm-d/llm-d-inference-scheduler/blob/main/docs/architecture.md)')
49+
4650
// Fix broken external references
4751
.replace(/\]\(\.\.\/\.\.\/precise-prefix-cache-aware\)/g, '](https://github.com/llm-d-incubation/llm-d-infra/tree/main/quickstart/examples/precise-prefix-cache-aware)')
48-
// Fix file references to point to repository
49-
.replace(/\]\(([^)]+\.(yaml|sh))\)/g, '](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/examples/inference-scheduling/$1)')
52+
.replace(/\]\(precise-prefix-cache-aware\)/g, '](https://github.com/llm-d-incubation/llm-d-infra/tree/main/quickstart/examples/precise-prefix-cache-aware)')
53+
.replace(/\]\(\.\.\/precise-prefix-cache-aware\)/g, '](https://github.com/llm-d-incubation/llm-d-infra/tree/main/quickstart/examples/precise-prefix-cache-aware)')
54+
55+
// Fix relative path resolution for install-deps.sh (catch any remaining patterns)
5056
.replace(/\]\(\.\.\/\.\.\/\.\.\/([^)]+\.sh)\)/g, '](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/$1)')
51-
// Convert other relative markdown links to repository links
52-
.replace(/\]\(([^)]+\.md)\)/g, '](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/examples/inference-scheduling/$1)')
57+
// Fix any remaining ../../../*.md patterns before general md processing
58+
.replace(/\]\(\.\.\/\.\.\/\.\.\/([^)]+\.md)\)/g, '](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/$1)')
59+
60+
// Fix relative links (but be more careful)
61+
.replace(/\]\(\.\.\//g, '](../../')
62+
.replace(/\]\(\.\//g, '](')
63+
64+
// Fix file references to point to repository (only if not already a full URL)
65+
.replace(/\]\((?!https?:\/\/)([^)]+\.(yaml|sh))\)/g, '](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/examples/inference-scheduling/$1)')
66+
67+
// Convert other relative markdown links to repository links (only if not already a full URL)
68+
.replace(/\]\((?!https?:\/\/)([^)]+\.md)\)/g, '](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/examples/inference-scheduling/$1)')
5369
});
5470
}
5571
return undefined;
5672
},
5773
},
58-
];
74+
];

remote-content/remote-sources/guide-prerequisites.js

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Guide Prerequisites Remote Content
3-
*
3+
*
44
* Downloads the quickstart README.md file from the llm-d-infra repository
55
* and transforms it into docs/guide/Installation/prerequisites.md
66
*/
@@ -15,11 +15,11 @@ export default [
1515
sourceBaseUrl: 'https://raw.githubusercontent.com/llm-d-incubation/llm-d-infra/main/',
1616
outDir: 'docs/guide/Installation',
1717
documents: ['quickstart/README.md'],
18-
18+
1919
// Plugin behavior
2020
noRuntimeDownloads: false, // Download automatically when building
2121
performCleanup: true, // Clean up files after build
22-
22+
2323
// Transform the content for this specific document
2424
modifyContent(filename, content) {
2525
if (filename === 'quickstart/README.md') {
@@ -35,22 +35,36 @@ export default [
3535
content,
3636
// Transform content to work in docusaurus context
3737
contentTransform: (content) => content
38-
// Fix any relative links that might break
39-
.replace(/\]\(examples\//g, '](../')
40-
.replace(/\]\(\.\//g, '](')
4138
// Fix MDX compilation issues with angle bracket URLs
4239
.replace(/<(http[s]?:\/\/[^>]+)>/g, '`$1`')
43-
// Convert relative markdown links to repository links
44-
.replace(/\]\(([^)]+\.md)\)/g, '](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/$1)')
45-
// Fix file links to point to repository
46-
.replace(/\]\(([^)]+\.(yaml|json|sh))\)/g, '](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/$1)')
4740
// Fix broken anchor reference
4841
.replace(/#openshift-and-grafana/g, '#install-on-openshift')
42+
43+
// Fix specific problematic links first (before general patterns)
44+
.replace(/\[Grafana\ setup\ guide\]\(\.\/grafana\-setup\.md\)/g, '[Grafana setup guide](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/docs/monitoring/grafana-setup.md)')
45+
.replace(/\[llm\-d dashboard\]\(\.\/grafana\/dashboards\/llm\-d\-dashboard\.json\)/g, '[llm-d dashboard](https://raw.githubusercontent.com/llm-d-incubation/llm-d-infra/refs/heads/main/quickstart/docs/monitoring/grafana/dashboards/llm-d-dashboard.json)')
46+
.replace(/\[inference\-gateway\ dashboard\]\(https\:\/\/github\.com\/kubernetes\-sigs\/gateway\-api\-inference\-extension\/blob\/main\/tools\/dashboards\/inference\_gateway\.json\)/g, '[inference-gateway dashboard](https://raw.githubusercontent.com/kubernetes-sigs/gateway-api-inference-extension/refs/heads/main/tools/dashboards/inference_gateway.json)')
47+
48+
// Fix OpenShift documentation links - use a simple string replacement first
49+
.replace(/docs\/infra-providers\/openshift\/README-openshift\.md/g, 'https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/docs/infra-providers/openshift/README-openshift.md')
50+
// More general pattern for remaining docs paths (only if not already a full URL)
51+
.replace(/\]\((?!https?:\/\/)docs\/([^)]+)\)/g, '](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/docs/$1)')
52+
4953
// Fix relative path references to files
5054
.replace(/\]\(grafana\/dashboards\/([^)]+)\)/g, '](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/grafana/dashboards/$1)')
55+
56+
// Fix any remaining relative links that might break (but avoid full URLs)
57+
.replace(/\]\(examples\//g, '](../')
58+
.replace(/\]\(\.\//g, '](')
59+
60+
// Convert relative markdown links to repository links (only if not already a full URL)
61+
.replace(/\]\((?!https?:\/\/)([^)]+\.md)\)/g, '](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/$1)')
62+
// Fix file links to point to repository (only if not already a full URL)
63+
.replace(/\]\((?!https?:\/\/)([^)]+\.(yaml|json|sh))\)/g, '](https://github.com/llm-d-incubation/llm-d-infra/blob/main/quickstart/$1)')
64+
5165
});
5266
}
5367
return undefined;
5468
},
5569
},
56-
];
70+
];

src/components/Install/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function Install() {
3434
alt="2. "
3535
src={require('/docs/assets/counting-02.png').default}
3636
></img>
37-
<a className="link" href="docs/guide/Installation/quickstart#install">
37+
<a className="link" href="docs/guide/Installation/prerequisites">
3838
Run the Quickstart
3939
</a>
4040
</h3>
@@ -46,7 +46,7 @@ export default function Install() {
4646
alt="3. "
4747
src={require('/docs/assets/counting-03.png').default}
4848
></img>
49-
<a className="link" href="docs/guide/Installation/quickstart#examples">Explore llm-d!</a></h3>
49+
<a className="link" href="docs/guide/Installation/prerequisites#examples">Explore llm-d!</a></h3>
5050
{/* -------------------------------------------------------------------------- */}
5151
<a className="static-button install-button button-link" href="docs/guide">
5252
Complete install methods here

0 commit comments

Comments
 (0)