Conversation
Fix PR preview base path determination for forks targeting mume.github.io so builds use VITE_BASE=/pr-N/ on docs.mume.org. Add an automated link and asset path verification test script (npm test) integrated into CI workflows and Dockerfile to prevent path regression or broken asset references.
Fix PR preview base path determination for forks targeting mume.github.io so builds use VITE_BASE=/pr-N/ on docs.mume.org and /repo/pr-N/ on subdirectory forks. Add an automated link and asset path verification test script (npm test) integrated into CI workflows and Dockerfile to prevent path regression or broken asset references.
Contributor
Reviewer's GuideThe PR fixes deployment-prefix handling for forks and case variations, preserves explicit VITE_BASE settings, and introduces a generated-output test that validates internal links, asset references, and VitePress base metadata across deployment and container build paths. Flow diagram for deployment base URL validationflowchart TD
A["Determine repository and owner"] --> B["Normalize names to lowercase"]
B --> C{"Official user site?"}
C -->|yes| D["Use / prefix"]
C -->|no| E["Use /repository/ prefix"]
D --> F["Append pr-number prefix for PR previews"]
E --> F
F --> G["Build generated site with VITE_BASE"]
G --> H["npm test validates links, assets, and base metadata"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Fix PR preview base path determination for forks targeting mume.github.io so builds use VITE_BASE=/pr-N/ on docs.mume.org and /repo/pr-N/ on subdirectory forks. Add an automated link and asset path verification test script (npm test) integrated into CI workflows and Dockerfile to prevent path regression or broken asset references.
Contributor
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. If the base-path logic or new checks are wrong, the deployment can produce a site with broken links/assets or block an otherwise valid deployment. Reverting the change stops future failures, and an affected deployment can be repaired by rebuilding and redeploying.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Ensure fork previews use correct base URLs and validate generated links and assets across deployment environments.
Bug Fixes:
Enhancements:
Build:
CI:
Documentation:
Tests: