Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug causing mvb and vitepress build to fail when landoPlugin is s… #73

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Fixed bug causing `mvb` and `vitepress build` to fail when `landoPlugin` is set and `VPL_BASE_URL` or `NETLIFY ` are not

## v1.1.0 - [February 14, 2025](https://github.com/lando/vitepress-theme-default-plus/releases/tag/v1.1.0)

## New Features
Expand Down
7 changes: 4 additions & 3 deletions utils/get-base-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ export default function(landoPlugin) {
// if VPL_BASE_URL is set then use that
if (process.env?.VPL_BASE_URL) return process.env?.VPL_BASE_URL;

// if lando plugin and netlify prod then set to docs.lando.dev
if (landoPlugin && process.env?.NETLIFY && process.env.CONTEXT === 'production') return 'https://docs.lando.dev';

// otherwise we can try other stuff if we are on something like netlify
if (process.env?.NETLIFY && process.env.CONTEXT === 'production' && landoPlugin) return 'https://docs.lando.dev';
if (process.env?.NETLIFY && process.env.CONTEXT === 'production') return process.env.URL;
if (process.env?.NETLIFY && process.env.CONTEXT !== 'production') return process.env.DEPLOY_PRIME_URL;

// if we get here and its a lando plugin we can safely assume https://docs.lando.dev, this is mostly for github actions testing
if (landoPlugin) return 'https://docs.lando.dev';

// return nothing
return undefined;
};
Loading