File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -171,10 +171,19 @@ jobs:
171171 cd _site
172172
173173 # Rewrite config paths for side-nav filtering
174- if [ -f "localhost+3000/${SITE_PATH}/config" ]; then
175- perl -i -pe "s|href=\"/${SITE_PATH}/|href=\"/${PATH_PREFIX}/${SITE_PATH}/|g" "localhost+3000/${SITE_PATH}/config"
176- perl -i -pe "s|href=\"/functional-testing-framework/|href=\"/${PATH_PREFIX}/${SITE_PATH}/functional-testing-framework/|g" "localhost+3000/${SITE_PATH}/config"
177- perl -i -pe "s|href=\"/guide/|href=\"/${PATH_PREFIX}/${SITE_PATH}/guide/|g" "localhost+3000/${SITE_PATH}/config"
174+ CONFIG_FILE="localhost+3000/${SITE_PATH}/config"
175+ if [ -f "$CONFIG_FILE" ]; then
176+ # Rewrite the main site path
177+ perl -i -pe "s|href=\"/${SITE_PATH}/|href=\"/${PATH_PREFIX}/${SITE_PATH}/|g" "$CONFIG_FILE"
178+
179+ # Extract unique top-level nav paths from config.md pages section
180+ # Looks for patterns like [Label](/path/...) and extracts the first directory segment
181+ grep -oE '\]\(/[^/)]+/' ../content/src/pages/config.md | \
182+ sed 's/](//' | \
183+ sort -u | while read nav_path; do
184+ perl -i -pe "s|href=\"${nav_path}|href=\"/${PATH_PREFIX}/${SITE_PATH}${nav_path}|g" "$CONFIG_FILE"
185+ done
186+
178187 echo "✓ Config paths rewritten"
179188 fi
180189
You can’t perform that action at this time.
0 commit comments