diff --git a/CHANGELOG.md b/CHANGELOG.md index 6712c42..40ebbd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/utils/get-base-url.js b/utils/get-base-url.js index 54169b4..f99e6e4 100644 --- a/utils/get-base-url.js +++ b/utils/get-base-url.js @@ -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; };