feat: implement dynamic baseUrl for flexible deployments previews #21
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.
Implement Dynamic baseUrl for Flexible Deployments
This PR introduces a dynamic
baseUrlconfiguration for Docusaurus, enabling flexible deployments and improving our ability to verify changes in preview environments.Problem
Previously, we were unable to effectively test PR changes in preview deployments. Setting the
baseUrlto '/docs/' caused Docusaurus assets and CSS to break in these preview environments.Solution
Implemented a dynamic
baseUrlconfiguration that adapts to different deployment environments:baseUrlis set to '/docs/'baseUrldefaults to '/'This approach allows us to:
abc.com/docsEnvironment Variable Setup
For production deployments only, add the following environment variable:
Important: Do not add this environment variable for preview deployments. The absence of this variable will default
baseUrlto '/', ensuring correct functionality in preview environments.Please review and test this change thoroughly in both preview and production environments.