Skip to content

Commit

Permalink
improve lando configset base support (#72)
Browse files Browse the repository at this point in the history
* improve lando configset base support

* improve lando configset base support part 2
  • Loading branch information
pirog authored Feb 14, 2025
1 parent fc8db2d commit c798d3c
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 2 deletions.
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

## New Features

* Added `version` alias information to config
* Added `RegEx` support for `internalDomains` matching
* Added `get-base-url` helper util
* Added `is-faux-internal` helper util
* Added `caching` to `mvb` multiversion build
* Added better dev `branch` detection to `mvb`
* Added `frontmatter.url-loader` to allow `.md` files to pull content from remote `markdown` sources
* Added new `multiversion-vitepress-build` command
* Added `useTags` composable to get docs version information from `git`
* Added `VPLVersionLink` component
* Changed `VPLVersionLink` to _not_ normalize links
* Improved `get-tags` and `mvb` to better handle scenarios with no matchings versions or tags
* Improved robustness of `mvb` build environment generation
* Improved `is-dev-release` to handle `dev` releases that are in front of a prerelease tag
* Improved dev release resolution
* Improved `mvb` and `root` link normalization
* Improved `VPLVersionLink` to only need `version` input
* Switched these docs to `multiversion-vitepress-build`
* Updated to [[email protected]](https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md)
* Updated `scss` and `sass` compilation to `modern-compiler`

## Bug Fixes

* Fixed `frontmatter.editLink` to fallback to theme and default `text` if not passed in
* Fixed incorrect `lodash-es/uniq.js` import in `landov3` config set
* Fixed bug causing build error when `metadata` is added to a page with no `git` history
* Fixed bug caused by `icon` being a variable instead of a string in `VPLTeamMembersItem`
* Fixed bug caused by `VPLTeamMembers.members` typing as `Object` instead of `Array`
* Fixed bug causing `robots.txt` policies to not be applied when using `policies` instead of `policy`
* Fixed watch bug on `VPLCollectionItems` preventing tag toggling from working correctly
* Fixed bug in `VPLLink` causing some links to to not normalize correctly
* Fixed bug causing `VPLDocFooter` bleed over with some `frontmatter` combinations of `prev` and `next`
* Fixed `semver` import causing all kinds of chaos when importing this theme as a package
* Fixed bug causing `alias.dev` to always report highest built tag instead of actual dev version
* Fixed `useTags()` to return correct links for sites with non-root `base` considerations take 2
* Fixed `prev-next` calculation when using sites with non `/` bases [#55](https://github.com/lando/vitepress-theme-default-plus/pull/55)
* Fixed bug with `<VPLLink>` not dynamically updating and showing strange behavior for `prev|next` links
* Fixed bug causing `active` to not be correctly set on `VPLNavBarMenuGroup`
* Fixed bug in `normalize-mvb` causing `multiVersionBuild.build` to sometimes not be set correctly
* Fixed `lando` configset bug causing `sidebarEnder` to not merge correctly
* Fixed bug preventing user specified `buildEnd` and `transformPageData` from running after theme's
* Fixed bug preventing `mvb` from correctly setting the `mvbase`
* Fixed duplicate `//` in generated `rss` feed
* Fixed bug causing `robots.txt` build to throw an error when `policies` is `undefined`
* Fixed bug causing `netlify` specific `mvb` to not get current tags

## v1.1.0-beta.24 - [November 23, 2024](https://github.com/lando/vitepress-theme-default-plus/releases/tag/v1.1.0-beta.24)

* Improved `mvb` tag fetching to ensure remote tags are canonical for version building, fixes `would clobber existing tag` error(s)
Expand Down
3 changes: 3 additions & 0 deletions config/landov3.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export default function({
baseUrl = getBaseUrl() ?? 'https://docs.lando.dev',
navrel = 'root',
} = {}) {
// if this is a lando plugin then reset the baseUrl
if (landoPlugin) baseUrl = getBaseUrl(landoPlugin);

// reset the base if its undefined
if (!base) base = landoPlugin ? `/plugins/${landoPlugin}/` : '/';

Expand Down
3 changes: 3 additions & 0 deletions config/landov4.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export default function({
baseUrl = getBaseUrl() ?? 'https://docs.lando.dev',
navrel = 'root',
} = {}) {
// if this is a lando plugin then reset the baseUrl
if (landoPlugin) baseUrl = getBaseUrl(landoPlugin);

// reset the base if its undefined
if (!base) base = landoPlugin ? `/plugins/${landoPlugin}/` : '/';

Expand Down
1 change: 0 additions & 1 deletion docs/.vitepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export default defineConfig({
description: 'The VitePress default theme with some MOARPOWAH!',
base: '/',
lang: 'en-US',
landoDocs: '3',
head: [
['link', {rel: 'icon', type: 'image/png', href: '/images/vitepress-lando-logo-mini.png'}],
['meta', {name: 'og:type', content: 'website'}],
Expand Down
5 changes: 4 additions & 1 deletion utils/get-base-url.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// @TODO: support other platforms besides netlify?

export default function() {
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 'docs.lando.dev';

// otherwise we can try other stuff if we are on something like netlify
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;
Expand Down

0 comments on commit c798d3c

Please sign in to comment.