diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index 3cb3acc..5c1a6c6 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -60,68 +60,66 @@ jobs: echo "=== Documentation processed for static hosting ===" echo "Hosting base path: $DOCC_HOSTING_BASE_PATH" - - name: Add .nojekyll and root redirect + 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 "=== 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: Fix resource paths and add .nojekyll run: | # Add .nojekyll to prevent GitHub Pages from ignoring files starting with _ touch DocsBuild/.nojekyll - # 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 + # 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'