-
Notifications
You must be signed in to change notification settings - Fork 0
Claude/fix docc GitHub pages urls 011 cv2q14o ul mhe eh tb hv hsq #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Claude/fix docc GitHub pages urls 011 cv2q14o ul mhe eh tb hv hsq #26
Conversation
Adding debug output to understand: - What directories DocC creates - Where documentation files are located - Where tutorial files are located - What the original index.html contains before we replace it This will help determine: 1. If /documentation/navigationsplitview/ is the correct path 2. Whether the redirect is interfering with generated content 3. What the proper structure should be Current status: - Tutorials work: /tutorials/navigationsplitview/navigationsplitviewimplementation/ ✅ - Documentation 404: /documentation/navigationsplitview/ ❌ Need to see the actual generated structure to fix the redirect.
Issue identified: No /documentation/ directory is generated by DocC when using standalone documentation catalog (without Swift target). Changes: - Removed custom redirect that pointed to non-existent /documentation/navigationsplitview/ - Kept .nojekyll file (still needed for GitHub Pages) - Let DocC's generated index.html work as-is - Added more debug output: * index/ directory contents * data/ directory structure * metadata.json content For standalone documentation catalogs, DocC may: - Put content directly at root - Use /tutorials/ for tutorials - Have different navigation structure Next step: See what the original index.html does and if it provides proper navigation to available content (tutorials, articles).
Issue: Even with DOCC_HOSTING_BASE_PATH set in Xcode project, DocC still generates absolute paths from root in the HTML: - var baseUrl = "/" (should be /NavigationSplitView/) - src="/js/..." (should be /NavigationSplitView/js/...) - href="/css/..." (should be /NavigationSplitView/css/...) The Xcode build setting alone is not sufficient to fix this. Solution: Keep DocC's generated index.html structure (for proper navigation), but fix the resource paths with sed: HTML fixes: - var baseUrl variable - script src attributes for JS - link href attributes for CSS - favicon paths JavaScript fixes: - /data/ paths - /tutorials/ paths - /index/ paths This is more targeted than before - we fix paths but don't replace the entire index.html, preserving DocC's navigation structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| find DocsBuild -type f -name "*.html" -exec sed -i '' \ | ||
| -e 's|var baseUrl = "/"|var baseUrl = "/'$DOCC_HOSTING_BASE_PATH'/"|g' \ | ||
| -e 's|src="/js/|src="/'$DOCC_HOSTING_BASE_PATH'/js/|g' \ | ||
| -e 's|src="/css/|src="/'$DOCC_HOSTING_BASE_PATH'/css/|g' \ | ||
| -e 's|href="/css/|href="/'$DOCC_HOSTING_BASE_PATH'/css/|g' \ | ||
| -e 's|href="/favicon.ico"|href="/'$DOCC_HOSTING_BASE_PATH'/favicon.ico"|g' \ | ||
| -e 's|href="/favicon.svg"|href="/'$DOCC_HOSTING_BASE_PATH'/favicon.svg"|g' \ | ||
| {} + | ||
| # Fix paths in JavaScript files | ||
| echo "=== Fixing paths in JavaScript files ===" | ||
| find DocsBuild -type f -name "*.js" -exec sed -i '' \ | ||
| -e 's|"/data/|"/'$DOCC_HOSTING_BASE_PATH'/data/|g' \ | ||
| -e 's|"/tutorials/|"/'$DOCC_HOSTING_BASE_PATH'/tutorials/|g' \ | ||
| -e 's|"/index/|"/'$DOCC_HOSTING_BASE_PATH'/index/|g' \ | ||
| {} + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patch JS rewrites miss root JSON and single-quoted URLs
The new sed invocation only rewrites double-quoted "/data/, "/tutorials/, and "/index/ strings, but DocC’s generated JavaScript also fetches assets via single-quoted paths and root-level JSON files such as theme-settings.json. Without rewriting those to include $DOCC_HOSTING_BASE_PATH, the browser still requests https://<user>.github.io/theme-settings.json and other /documentation/… resources from the site root, which yields 404s when the docs are hosted under /NavigationSplitView. Consider adding patterns for '...' paths and root JSON files (as previously done) so all asset URLs receive the base path.
Useful? React with 👍 / 👎.
No description provided.