Conversation
☁️ Cloudflare Worker Preview Deployed!🔗 https://ks-fix-301-docs-index-links-docs.kestra-io.workers.dev 🔦 Lighthouse Benchmark
Scores (0–100, higher is better)
Core Web Vitals (lower is better)
Legend🟢 improved · 🔻 regressed · (blank) no significant change Median of repeated runs: Home x5, About Us x3, Docs Landing x5, Flow (full featured docs) x3, Plugins Landing x3, Blueprints Landing x3. A single run of these swings 20+ points between runners. View full Lighthouse HTML report for a pageFull per-page Lighthouse Results (LHR) are attached as the |
iitzIrFan
left a comment
There was a problem hiding this comment.
Approving — the resolution logic checks out.
I ran the old astro.config.mjs replacer and the new resolveRelativeDocLink side by side over every relative markdown link in src/contents/** (~1500 links, all collections, since the markdown processor is global). Exactly 41 outputs change: the 35 ./index.md links under api-reference/03.problems/ and the 6 ../index.md* links in index files. Everything else resolves identically, so no collateral change to blogs/orchestration/resources.
I then resolved each rewritten href against its own page URL (computed with the same generateId the content loader uses) and matched it against the set of doc ids — all of them land on an existing page, including the two that could have gone wrong in generateId: v2.0.0 survives intact (../v2.0.0) and 16.scripts loses only its ordering prefix (../scripts).
The climb = ups + 1 for leaf files vs ups for index files is right, since generateId only strips ordering prefixes and never collapses a segment — URL depth mirrors filesystem depth. astro sync loads the config fine, path is still used after the generateId import was dropped, and the new test is picked up by vitest's src/**/*.test.ts include.
One non-blocking nit, in content rather than in this diff:
src/contents/docs/05.workflow-components/07.triggers/05.realtime-trigger/index.md:11
Most Kestra [triggers](./index.md) poll external systems at a fixed interval./index.md from an index file means "this directory's index", so it resolves to realtime-trigger — the page linking to itself. The prose means the parent triggers page, so it should be ../index.md, which this PR now resolves to ../triggers.
It's a pre-existing typo and the preserved ./index.md-from-an-index-file branch is correct as written (the test at resolve-doc-link.test.ts:44 pins the right behaviour). But since this PR is about making index links land on the right page, it's the one index link in the corpus still pointing at the wrong one — a natural one-line addition here, or a follow-up if you'd rather keep the diff to the resolver.
|
Concrete version of the nit from my review, if you want to fold it in — and a correction: I wrote
-Most Kestra [triggers](./index.md) poll external systems at a fixed interval, which works well for batch processing.
+Most Kestra [triggers](../index.mdx) poll external systems at a fixed interval, which works well for batch processing.That matches what the sibling page already does —
Worth noting the fix depends on this branch: on |
Two relative-link shapes in docs sources resolved to a directory URL with a trailing slash, which the site 301s:
./index.mdfrom a leaf file (api-reference/03.problems/*.md→/docs/api-reference/problems/, 35 links)../index.mdfrom an index file (triggers/,migration-guide/v2.0.0/,task-runners/,scripts/,cicd/,rbac/, 6 links)The remark link replacer moves out of
astro.config.mjsintosrc/markdown/remark/resolve-doc-link.tsand resolves those two shapes to the directory segment explicitly (../problems,../triggers). Other relative links keep their previous resolution, which the tests pin.