Skip to content

Conversation

@AnnsAnns
Copy link
Member

Contribution description

@miri64 noticed that the edit link was broken when the site was generated using one of the root markdown files, this should fix that.

Testing procedure

make doc-starlight and then click on the edit page link on e.g. Security

Issues/PRs references

@github-actions github-actions bot added the Area: doc Area: Documentation label Jan 13, 2026

if (starlightRoute.editUrl) {
let editUrl = starlightRoute.editUrl.toString();

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

(somehow, Github renders this suggestion weirdly. I mean: remove trailing whitespaces, please, i.e., keep the line empty)

const filename = editUrl.split(generatedPath)[1];
editUrl = editUrl.split(generatedPath)[0] + '/' + filename;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too.

Suggested change

@miri64 miri64 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jan 13, 2026
Comment on lines +18 to +19
const filename = editUrl.split(generatedPath)[1];
editUrl = editUrl.split(generatedPath)[0] + '/' + filename;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand this (very weird; why not just use '/' as a token and use the first and last element of the string) parsing step, this basically assumes that all files were generated from root. This invites potential footguns IMHO and also might lead to maybe unrelated files (something about boards/ e.g.) hogging the already quite crowded root path. I'd rather have a mapping somewhere, where the name of the generated file is mapped to the original source. It can be in this file, but maybe it makes sense to hook this directly into the generation somehow. This way, we would avoid risks of the generation and the edit links going potentially out of sync.

@riot-ci
Copy link

riot-ci commented Jan 13, 2026

Murdock results

✔️ PASSED

ee8b27f doc/starlight: fix edit link for generated documents

Success Failures Total Runtime
1 0 1 01m:13s

Artifacts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: doc Area: Documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants