Skip to content

docs: remove .html extensions from all URLs site-wide#90

Merged
jpr5 merged 1 commit intoCopilotKit:mainfrom
NathanTarbert:fix/clean-homepage-url
Apr 7, 2026
Merged

docs: remove .html extensions from all URLs site-wide#90
jpr5 merged 1 commit intoCopilotKit:mainfrom
NathanTarbert:fix/clean-homepage-url

Conversation

@NathanTarbert
Copy link
Copy Markdown
Contributor

@NathanTarbert NathanTarbert commented Apr 7, 2026

Summary

  • Restructure all doc pages from page.html to page/index.html directories so GitHub Pages serves clean URLs (e.g. /docs instead of /docs.html)
  • Update all internal href links across every HTML file and sidebar.js to use extensionless paths
  • Add history.replaceState fallback in the root index.html to silently rewrite /index.html/ for direct visits (bookmarks, search engines, old links)
  • Update sidebar.js current-page detection to work with directory-based URLs

Test plan

  • Visit aimock.copilotkit.dev — URL stays / (no /index.html)
  • Click "Docs" in the navbar — URL is /docs (no /docs.html)
  • Click any sidebar link — URL has no .html extension
  • Click the logo or "Home" from any doc page — URL is /
  • Navigate directly to /index.html — URL rewrites to /
  • Sidebar highlighting still works on all pages

Replace all href="index.html" links with href="/" across doc pages
so navigating Home produces a clean URL. Add history.replaceState
fallback in index.html for direct visits to /index.html.
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 7, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@copilotkit/aimock@90

commit: b1450d9

Copy link
Copy Markdown
Contributor

@jpr5 jpr5 left a comment

Choose a reason for hiding this comment

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

PR Review

Mechanical docs-only change — same 2-line substitution (href="index.html"href="/") across 35 HTML pages. Verified all 35 files have the identical pattern.

The three non-mechanical pieces are correct:

  • index.html: history.replaceState rewrites /index.html/ for direct visits. Only fires on exact pathname match, won't affect other pages. Clean.
  • sidebar.js: if (currentPage === "" || currentPage === "/") currentPage = "index.html" — handles the new clean URL so sidebar highlighting still works on homepage. Correct.
  • No source code changes — only docs/ files touched.

Zero findings. LGTM.

🤖 Reviewed with Claude Code

@jpr5 jpr5 merged commit 3bdc79f into CopilotKit:main Apr 7, 2026
11 checks passed
@NathanTarbert NathanTarbert deleted the fix/clean-homepage-url branch April 7, 2026 22:36
@NathanTarbert NathanTarbert changed the title docs: remove /index.html from homepage URL docs: remove .html extensions from all URLs site-wide Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants