Fix DocC resource URLs on GitHub Pages#21
Merged
SoundBlaster merged 2 commits intomainfrom Nov 11, 2025
Merged
Conversation
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/"
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: