Skip to content

Commit

Permalink
fix bug causing mvb and vitepress build to fail when landoPlugin is s…
Browse files Browse the repository at this point in the history
…et but VPL_BASE_URL or NETLIFYT are not
  • Loading branch information
pirog committed Feb 14, 2025
1 parent 0d94dde commit 54cfab3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
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;
};

0 comments on commit 54cfab3

Please sign in to comment.