Skip to content

Conversation

@akash3444
Copy link
Contributor

Implement Dynamic baseUrl for Flexible Deployments

This PR introduces a dynamic baseUrl configuration 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 baseUrl to '/docs/' caused Docusaurus assets and CSS to break in these preview environments.

Solution

Implemented a dynamic baseUrl configuration that adapts to different deployment environments:

  • For production: baseUrl is set to '/docs/'
  • For preview deployments: baseUrl defaults to '/'

This approach allows us to:

  1. Maintain the correct configuration for our production site at abc.com/docs
  2. Properly render and test changes in preview deployments

Environment Variable Setup

For production deployments only, add the following environment variable:

BASE_URL=/docs/

Important: Do not add this environment variable for preview deployments. The absence of this variable will default baseUrl to '/', ensuring correct functionality in preview environments.

Please review and test this change thoroughly in both preview and production environments.

@vercel
Copy link

vercel bot commented Oct 17, 2024

@akash3444 is attempting to deploy a commit to the PearAI Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Oct 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
documentation-page-pearai-landing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2024 8:01pm

@jpan8866
Copy link
Contributor

env added to prod, tested

@jpan8866 jpan8866 merged commit 6e424c0 into trypear:main Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants