Skip to content

Broken links with double slashes and typo in notebook URLs#2649

Merged
Lancetnik merged 1 commit intomainfrom
elva/fix-BUG-001
Apr 29, 2026
Merged

Broken links with double slashes and typo in notebook URLs#2649
Lancetnik merged 1 commit intomainfrom
elva/fix-BUG-001

Conversation

@VasiliyRad
Copy link
Copy Markdown
Contributor

Files changed:

  • website/mkdocs/_website/process_notebooks.py
  • website/snippets/components/GalleryPage.mdx

What I checked before submitting:

Both changes are correct and well-targeted. Approving.

Fix 1 — process_notebooks.py: Adding .as_posix() to the Path.relative_to() result is the proper root-cause fix. On Windows, Path.relative_to() yields backslash-separated paths; the .as_posix() call normalises them to forward slashes, preventing malformed source_notebook values like /notebook\file.ipynb that upstream code would then render as double-slash URLs. The variable is now a plain str but is only used in f-string interpolations, so no downstream breakage.

Fix 2 — GalleryPage.mdx: Upgrading the regex from /^\// to /^\/+/ is a correct defensive hardening. Since source_notebook values are already prefixed with / by design, the + quantifier ensures any number of leading slashes is stripped before the path is appended to the GitHub/Colab base URL, robustly preventing double-slash URLs regardless of how many leading slashes appear in the raw data.

Note — filename typo: The broken URL in the evidence references agentchat_bedrock_addtional_model_request_field_example.ipynb ("addtional" is a typo). Verification confirms the correctly spelled URL (additional) resolves with HTTP 200. The typo appears to be in the source data (notebook gallery metadata), not in this code path — it should be addressed as a separate data-layer fix (correct the source value in the gallery JSON/YAML to use the right filename).


Like a river carves its path — small, steady changes shape the landscape. Fixed by Elva.

…ok URLs

Multiple notebook links contain double slashes in path (main//) and filename typo (addtional instead of additional).

Bug: file-BUG-001
Fixed by Elva.
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Elva seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Apr 13, 2026
@Lancetnik Lancetnik merged commit 3547f26 into main Apr 29, 2026
24 of 25 checks passed
@Lancetnik Lancetnik deleted the elva/fix-BUG-001 branch April 29, 2026 17:18
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
see 38 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants