Skip to content

Fix lesson loading on private GitHub Pages - #3

Merged
jamesmontemagno merged 1 commit into
mainfrom
copilot/unable-to-load-lesson-error
Sep 16, 2026
Merged

jamesmontemagno merged 1 commit into
mainfrom
copilot/unable-to-load-lesson-error

Conversation

Copilot AI commented Sep 16, 2026

Copy link
Copy Markdown

Lessons returned HTTP 404 because the site root was inferred from GitHub Pages hostname conventions. Private Pages hosts the workshop at the domain root, causing Markdown requests to include an extra /workshop segment.

Changes

  • Resolve the site root relative to the lesson page:
    new URL('../', lessonPageUrl)
  • Use the shared resolver for lesson Markdown and target-app URLs.
  • Cover private root-hosted and project-path Pages layouts.

Co-authored-by: jamesmontemagno <1676321+jamesmontemagno@users.noreply.github.com>
@jamesmontemagno
jamesmontemagno marked this pull request as ready for review September 16, 2026 15:59
Copilot AI balanced review requested due to automatic review settings September 16, 2026 15:59
@jamesmontemagno
jamesmontemagno merged commit 9f885df into main Sep 16, 2026
18 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The relative URL logic is correct for both layouts, and the navigation tests pass.

This review doesn't count toward merge requirements.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes lesson and target-app URL resolution across private and project-path GitHub Pages deployments.

Changes:

  • Adds a shared relative site-root resolver.
  • Uses it for lesson Markdown and target-app URLs.
  • Tests root-hosted and project-path layouts.
File Description
docs/​workshop/​step.html Uses the shared site-root resolver.
docs/​language-navigation.js Adds and exports siteRootUrl.
docs/​tests/​markdown-language-preprocessor.test.js Covers both Pages layouts.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

3 participants