Skip to content

Fix: resolve "Edit this page" to the repository that holds each docs version - #124

Merged
Ibrahim2595 merged 1 commit into
mainfrom
fix/versioned-docs-edit-url
Sep 24, 2026
Merged

Ibrahim2595 merged 1 commit into
mainfrom
fix/versioned-docs-edit-url

Conversation

@Ibrahim2595

Copy link
Copy Markdown
Contributor

What & why

Closes rossoctl/rossoctl#2584.

"Edit this page" returns a 404 on every page of the published v0.7 documentation. On
Install for laptop the link resolves to:

https://github.com/rossoctl/rossoctl/tree/main/docs/versioned_docs/version-0.7/getting-started/install-local.md

That path does not exist in rossoctl/rossoctl. The versioned snapshots are committed here, in
rossoctl/.github, beside the site.

editUrl was one string pointing at rossoctl/rossoctl. That is right for dev, whose pages are
mirrored from that repository's docs/ tree by scripts/sync-docs.sh, and wrong for every released
version. Because one string applies to all versions, the contribution path was closed for the whole
latest version — a reader who finds a typo on a released page cannot reach the source.

What changed

editUrl becomes a function of the version:

  • version === 'current' (the dev docs) → rossoctl/rossoctl:docs/<docPath>, unchanged behaviour.
  • any released version → this repository, <versionDocsDirPath>/<docPath>.

versionDocsDirPath is the version's content root relative to the site directory, so it is already
versioned_docs/version-X.Y for a release. No version is hard-coded, which means the next release
needs no change to this callback
— consistent with how the rest of the version map is derived from
versions.json.

One file changed, docusaurus.config.ts. No content, no routing and no version map changes.

Verification

Against a production build (npm run sync-docs && npm run build), following the two steps in the
issue:

Version Pages Edit link target Unresolved
v0.7 (latest) 20 rossoctl/.github → versioned_docs/version-0.7/… 0
dev 45 rossoctl/rossoctl → docs/… 0

Every one of the 65 rendered links was mapped back to a file and checked for existence, rather than
only checked for the right shape. The 7 pages with no link are generated category indexes, which have
no source file and correctly render none.

npx tsc --noEmit: clean. Build: no errors, no new warnings.

Spot check of the previously broken URL, before and after:

$ # before — what the site linked to
$ curl -o /dev/null -sw '%{http_code}\n' https://github.com/rossoctl/rossoctl/tree/main/docs/versioned_docs/version-0.7/getting-started/install-local.md
404
$ # after — what the site links to now
$ curl -o /dev/null -sw '%{http_code}\n' https://github.com/rossoctl/.github/tree/main/versioned_docs/version-0.7/getting-started/install-local.md
301   # GitHub's normal /tree/ -> /blob/ redirect for a file

Note

The issue lists two adjacent gaps in the v0.7 content (no laptop section in users-guides/troubleshooting.md,
no feedback section in getting-started/install-local.md). Those are content in a frozen snapshot and
are out of scope here; they are addressed by cutting a release from the current dev tree, which is
the follow-up to this PR.

Separately, the contributing docs instance in this same file has an editUrl pointing at
Ibrahim2595/rossoctl-website, a repository that does not exist, so "Edit this page" on
/contributing/ is also dead. It is the same class of bug but a different plugin and a different
target, so it is left for its own PR rather than bundled here.

Assisted-By: Claude Code

…n #2584

"Edit this page" returned a 404 on every page of the published v0.7
documentation. The link pointed at
rossoctl/rossoctl/tree/main/docs/versioned_docs/version-0.7/..., a path that does
not exist in that repository: the versioned snapshots are committed here, in
rossoctl/.github, beside the site.

editUrl was a single string pointing at rossoctl/rossoctl. That is correct for
the dev version, whose pages are mirrored from that repository's docs/ tree by
scripts/sync-docs.sh, and wrong for every released version. Because the string
applies to all versions, the contribution path was closed for the whole latest
version: a reader who found a typo on a released page could not reach the source.

Make editUrl a function of the version. A page in the current (dev) version
resolves to rossoctl/rossoctl:docs/; a page in a versioned snapshot resolves to
this repository, using versionDocsDirPath as the prefix. versionDocsDirPath is
the version's content root relative to the site directory, so it is already
'versioned_docs/version-X.Y' for a release and needs no version hard-coded here.
The next release therefore needs no change to this callback.

Verified against a production build: every one of the 20 v0.7 pages resolves to a
file in versioned_docs/version-0.7/, and every one of the 45 dev pages resolves
to a file in rossoctl/rossoctl:docs/. The 7 remaining pages are generated
category indexes, which have no source file and correctly render no link.

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: IBRAHIM IBRAHIM <66755652+Ibrahim2595@users.noreply.github.com>
@netlify

netlify Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for animated-crumble-fb8862 ready!

Name Link
🔨 Latest commit 6e058ad
🔍 Latest deploy log https://app.netlify.com/projects/animated-crumble-fb8862/deploys/6ab575c7d5da67000838b25a
😎 Deploy Preview https://deploy-preview-124--animated-crumble-fb8862.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@Ibrahim2595
Ibrahim2595 merged commit 3634072 into main Sep 24, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

docs: "Edit this page" returns 404 on every v0.7 page — versioned docs live in rossoctl/.github

1 participant