Skip to content

Harden site link resolution for GitHub Pages#4

Merged
OgeonX-Ai merged 2 commits into
mainfrom
codex/implement-features-as-per-codex-instructions-929rq0
Jan 3, 2026
Merged

Harden site link resolution for GitHub Pages#4
OgeonX-Ai merged 2 commits into
mainfrom
codex/implement-features-as-per-codex-instructions-929rq0

Conversation

@OgeonX-Ai
Copy link
Copy Markdown
Contributor

Motivation

  • Fix broken internal navigation and search links when the static site is served from the docs/ root or from subpages under docs/pages/ on GitHub Pages.
  • Provide a single, robust way to compute a stable base path that handles trailing slashes and index.html variants.
  • Centralize path resolution logic in the site script to prevent future relative-path regressions.

Description

  • Added a complete documentation/site scaffold (multiple docs/* markdown files, docs/pages/* HTML pages, docs/assets/style.css, docs/assets/app.js, CI and GitHub templates) to provide a browsable static site and canonical docs.
  • Updated docs/assets/app.js to introduce getBasePath() and replace the previous simple resolver with resolveHref(targetPath) that trims trailing slashes, strips /index.html, and handles /pages/ segments to compute a stable base path.
  • Ensured navigation and search builders (buildNav() and setupSearch()) use the new resolveHref() so links resolve correctly from both the site root and subpages.
  • Kept the site lightweight (no external deps) and added an index.html and per-page HTML under docs/pages/ to validate the behavior.

Testing

  • Started a local server with python -m http.server 8000 and verified http://127.0.0.1:8000/index.html served correctly.
  • Ran a Playwright script to load the index page and capture a screenshot which completed and produced artifacts/docs-site-index-fixed.png, confirming rendered navigation.
  • Both the server check and the Playwright run succeeded.
  • Repository CI (.github/workflows/ci.yml) was added but was not executed as part of this change.

Codex Task

@OgeonX-Ai OgeonX-Ai merged commit 620f3c1 into main Jan 3, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant