From 3ec92cd3a29ba5a50703df77cddbd3089c0d3061 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 11 Nov 2025 23:17:43 +0000 Subject: [PATCH 1/3] Add debug output to investigate DocC structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/docc.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index 3cb3acc..34c0e0c 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -60,6 +60,26 @@ jobs: echo "=== Documentation processed for static hosting ===" echo "Hosting base path: $DOCC_HOSTING_BASE_PATH" + echo "" + echo "=== Directory structure ===" + find DocsBuild -type d | sort + + echo "" + echo "=== Files in documentation directory ===" + find DocsBuild/documentation -type f 2>/dev/null | head -20 || echo "No documentation directory found" + + echo "" + echo "=== Files in tutorials directory ===" + find DocsBuild/tutorials -type f 2>/dev/null | head -20 || echo "No tutorials directory found" + + echo "" + echo "=== Root level files ===" + ls -la DocsBuild/ + + echo "" + echo "=== Original index.html content ===" + cat DocsBuild/index.html + - name: Add .nojekyll and root redirect run: | # Add .nojekyll to prevent GitHub Pages from ignoring files starting with _ From d827d8bd5f81e375e48a212360abe18b4f0dbec2 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 11 Nov 2025 23:20:43 +0000 Subject: [PATCH 2/3] Remove redirect, let DocC's index.html work natively 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). --- .github/workflows/docc.yml | 74 +++++++++----------------------------- 1 file changed, 16 insertions(+), 58 deletions(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index 34c0e0c..f8aed76 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -76,72 +76,30 @@ jobs: echo "=== Root level files ===" ls -la DocsBuild/ + echo "" + echo "=== Index directory contents ===" + ls -la DocsBuild/index/ 2>/dev/null || echo "No index directory" + + echo "" + echo "=== Data directory structure ===" + find DocsBuild/data -type f 2>/dev/null | head -10 || echo "No data directory" + + echo "" + echo "=== metadata.json content ===" + cat DocsBuild/metadata.json 2>/dev/null || echo "No metadata.json" + echo "" echo "=== Original index.html content ===" cat DocsBuild/index.html - - name: Add .nojekyll and root redirect + - name: Add .nojekyll file run: | # Add .nojekyll to prevent GitHub Pages from ignoring files starting with _ touch DocsBuild/.nojekyll + echo "Added .nojekyll file" - # Create redirect from root to documentation page - # The actual documentation lives at /documentation// - cat > DocsBuild/index.html << 'EOF' - - - - - Redirecting to NavigationSplitView Documentation - - - - - -
-

NavigationSplitView Documentation

-

Redirecting to documentation...

-
- - - - EOF - - echo "=== Created root redirect ===" - cat DocsBuild/index.html + # NOTE: Not replacing index.html - let DocC's generated index.html work as-is + # DocC should generate proper navigation for standalone documentation catalogs - name: Upload documentation artifact if: github.event_name == 'push' From b3852d263fc9c7ea97ce4c8c0c1922c23a557c23 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 11 Nov 2025 23:22:54 +0000 Subject: [PATCH 3/3] Fix DocC resource paths with sed (Xcode setting not sufficient) 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. --- .github/workflows/docc.yml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index f8aed76..5c1a6c6 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -92,14 +92,34 @@ jobs: echo "=== Original index.html content ===" cat DocsBuild/index.html - - name: Add .nojekyll file + - name: Fix resource paths and add .nojekyll run: | # Add .nojekyll to prevent GitHub Pages from ignoring files starting with _ touch DocsBuild/.nojekyll - echo "Added .nojekyll file" - # NOTE: Not replacing index.html - let DocC's generated index.html work as-is - # DocC should generate proper navigation for standalone documentation catalogs + # Fix resource paths in HTML files + # Even with DOCC_HOSTING_BASE_PATH in Xcode, DocC still generates absolute paths + echo "=== Fixing resource paths in HTML files ===" + 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' \ + {} + + + echo "=== Fixed paths ===" + echo "Fixed index.html:" + head -5 DocsBuild/index.html - name: Upload documentation artifact if: github.event_name == 'push'