From 3e9f9ddcf15cd6ea4f5b55aafa04f620b5addaa2 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 11 Nov 2025 22:22:51 +0000 Subject: [PATCH] Fix DocC data and documentation paths in JavaScript MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After fixing HTML resource paths, the site loads but shows "page not found" because JavaScript code has hardcoded absolute paths. DocC is a Single Page Application (SPA) that loads data (JSON files) dynamically. The --hosting-base-path parameter only configures routing but doesn't fix absolute paths in the generated JavaScript code. JavaScript paths that need fixing: - "/data/" → "/NavigationSplitView/data/" - "/documentation/" → "/NavigationSplitView/documentation/" - "/tutorials/" → "/NavigationSplitView/tutorials/" Without this fix, the SPA tries to load data from: https://soundblaster.github.io/data/... Instead of: https://soundblaster.github.io/NavigationSplitView/data/... This causes 404 errors and the "page not found" message. Also improved debug output to show full index.html and check for NavigationSplitView references in JS files. --- .github/workflows/docc.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index 7cbbf88..ec4c35d 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -80,14 +80,32 @@ jobs: # Fix favicon paths sed -i '' 's|href="/favicon.ico"|href="/'$DOCC_HOSTING_BASE_PATH'/favicon.ico"|g' "$file" sed -i '' 's|href="/favicon.svg"|href="/'$DOCC_HOSTING_BASE_PATH'/favicon.svg"|g' "$file" + done + # Fix data and documentation paths in JavaScript files + # JavaScript code has hardcoded absolute paths that need the base path prefix + echo "=== Fixing paths in JavaScript files ===" + find DocsBuild -type f -name "*.js" | while read -r file; do # Fix data directory paths sed -i '' 's|"/data/|"/'$DOCC_HOSTING_BASE_PATH'/data/|g' "$file" + sed -i '' "s|'/data/|'/$DOCC_HOSTING_BASE_PATH/data/|g" "$file" + + # Fix documentation paths + sed -i '' 's|"/documentation/|"/'$DOCC_HOSTING_BASE_PATH'/documentation/|g' "$file" + sed -i '' "s|'/documentation/|'/$DOCC_HOSTING_BASE_PATH/documentation/|g" "$file" + + # Fix tutorials paths + sed -i '' 's|"/tutorials/|"/'$DOCC_HOSTING_BASE_PATH'/tutorials/|g' "$file" + sed -i '' "s|'/tutorials/|'/$DOCC_HOSTING_BASE_PATH/tutorials/|g" "$file" done # Debug: Show fixed index.html - echo "=== Fixed index.html (first 30 lines) ===" - head -30 DocsBuild/index.html || true + echo "=== Fixed index.html ===" + cat DocsBuild/index.html || true + + echo "" + echo "=== Checking for NavigationSplitView in JS files ===" + grep -o "NavigationSplitView" DocsBuild/js/*.js | head -5 || echo "Not found" - name: Upload documentation artifact if: github.event_name == 'push'