Skip to content

Fix DocC resource URLs on GitHub Pages#21

Merged
SoundBlaster merged 2 commits intomainfrom
claude/fix-docc-github-pages-urls-011CV2q14oULMheEHTbHVHsq
Nov 11, 2025
Merged

Fix DocC resource URLs on GitHub Pages#21
SoundBlaster merged 2 commits intomainfrom
claude/fix-docc-github-pages-urls-011CV2q14oULMheEHTbHVHsq

Conversation

@SoundBlaster
Copy link
Owner

The issue was that commit 15dd75c removed the sed command that fixes
the baseURL in index.html. While --hosting-base-path tells DocC where
resources should be located, it doesn't always correctly set the baseURL
in the generated HTML. The baseURL is used by the JavaScript app to
construct paths to resources.

Without this fix, resources are loaded from:
https://soundblaster.github.io/css/...
Instead of:
https://soundblaster.github.io/NavigationSplitView/css/...

This commit:

  • Restores --hosting-base-path NavigationSplitView (without leading slash)
  • Adds back the sed command to fix "baseURL": "/" to "/NavigationSplitView/"

The issue was that commit 15dd75c removed the sed command that fixes
the baseURL in index.html. While --hosting-base-path tells DocC where
resources should be located, it doesn't always correctly set the baseURL
in the generated HTML. The baseURL is used by the JavaScript app to
construct paths to resources.

Without this fix, resources are loaded from:
  https://soundblaster.github.io/css/...
Instead of:
  https://soundblaster.github.io/NavigationSplitView/css/...

This commit:
- Restores --hosting-base-path NavigationSplitView (without leading slash)
- Adds back the sed command to fix "baseURL": "/" to "/NavigationSplitView/"
Copy link
Owner Author

@SoundBlaster SoundBlaster left a comment

Choose a reason for hiding this comment

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

Ok

Based on code review feedback, this commit addresses several
maintainability and robustness concerns:

1. **Environment variable for base path**
   - Added DOCC_HOSTING_BASE_PATH env var at workflow level
   - Makes it easy to change the base path in one place
   - Both --hosting-base-path and sed command now use this variable

2. **Better Xcode version management**
   - Replaced hardcoded sudo xcode-select with maxim-lobanov/setup-xcode@v1
   - More resilient to GitHub runner environment changes
   - Clearer intent and better error messages

3. **Explicit cleanup for reproducibility**
   - Added rm -rf DocsArchive DocsBuild before build
   - Ensures clean state for both CI and local testing
   - Prevents issues with stale artifacts

These changes improve the workflow from 8.5/10 to a more robust
and maintainable solution, addressing the main concerns about:
- Hard-coded paths that could break
- Difficulty in adapting to different base paths
- Reproducibility in different environments
@SoundBlaster SoundBlaster merged commit c3cdec7 into main Nov 11, 2025
4 checks passed
@SoundBlaster SoundBlaster deleted the claude/fix-docc-github-pages-urls-011CV2q14oULMheEHTbHVHsq branch November 11, 2025 21:49
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