Skip to content

Conversation

@SoundBlaster
Copy link
Owner

No description provided.

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.
@SoundBlaster SoundBlaster merged commit c761ec8 into main Nov 11, 2025
4 checks passed
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Comment on lines +103 to +118
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' \
{} +

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

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