Skip to content

Fix DocC resource paths in HTML tags#23

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

Fix DocC resource paths in HTML tags#23
SoundBlaster merged 1 commit intomainfrom
claude/fix-docc-github-pages-urls-011CV2q14oULMheEHTbHVHsq

Conversation

@SoundBlaster
Copy link
Owner

The real issue was not the baseUrl JavaScript variable (which was already correct), but the resource paths in <script> and tags.

Problem identified from deployed HTML:

  • <script src="/js/chunk-vendors.bdb7cbba.js"> ❌
  • var baseUrl = "/NavigationSplitView/" ✅ (already correct)

These absolute paths load from root domain instead of the subdirectory. Should be: /NavigationSplitView/js/..., /NavigationSplitView/css/...

This is a known DocC bug: --hosting-base-path configures internal routing but doesn't fix the resource paths in HTML tags.

Solution:

  • Use sed to prepend base path to all resource URLs in HTML
  • Fix: src="/js/ → src="/NavigationSplitView/js/
  • Fix: href="/css/ → href="/NavigationSplitView/css/
  • Fix: favicon paths
  • Fix: data directory paths

Added debug output to show before/after HTML for verification.

The real issue was not the baseUrl JavaScript variable (which was
already correct), but the resource paths in <script> and <link> tags.

Problem identified from deployed HTML:
- <script src="/js/chunk-vendors.bdb7cbba.js"> ❌
- <link href="/css/index.3a335429.css"> ❌
- var baseUrl = "/NavigationSplitView/" ✅ (already correct)

These absolute paths load from root domain instead of the subdirectory.
Should be: /NavigationSplitView/js/..., /NavigationSplitView/css/...

This is a known DocC bug: --hosting-base-path configures internal
routing but doesn't fix the resource paths in HTML tags.

Solution:
- Use sed to prepend base path to all resource URLs in HTML
- Fix: src="/js/ → src="/NavigationSplitView/js/
- Fix: href="/css/ → href="/NavigationSplitView/css/
- Fix: favicon paths
- Fix: data directory paths

Added debug output to show before/after HTML for verification.
@SoundBlaster SoundBlaster merged commit 68bde65 into main Nov 11, 2025
4 checks passed
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