diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b69ef8..2dc71c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,11 +3,12 @@ * Added `normalize2base` helper client util * Added `normalizeMVB` helper client util * Added `normalizeRoot` helper client util +* Added `version` alias information to config * Fixed bug preventing user specified `buildEnd` and `transformPageData` from running after theme's * Fixed bug preventing `mvb` from correctly setting the `mvbase` * Improved `mvb` an `root` link normalization * Improved `VPLVersionLink` to only need `version` input -* Updated to [vitepress@1.5.](https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md) +* Updated to [vitepress@1.5.0](https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md) ## v1.1.0-beta.18 - [November 4, 2024](https://github.com/lando/vitepress-theme-default-plus/releases/tag/v1.1.0-beta.18) diff --git a/config.js b/config.js index ea06a6d..b734054 100644 --- a/config.js +++ b/config.js @@ -15,6 +15,7 @@ import {default as getBaseUrl} from './utils/get-base-url.js'; import {default as getContributors} from './utils/get-contributors.js'; import {default as getGaHeaders} from './utils/get-ga-headers.js'; import {default as getHubspotHeaders} from './utils/get-hubspot-headers.js'; +import {default as getTags} from './utils/get-tags.js'; import {default as normalizeMVB} from './utils/normalize-mvb.js'; import {default as parseLayouts} from './utils/parse-layouts.js'; import {default as traverseUp} from './utils/traverse-up.js'; @@ -178,10 +179,19 @@ export async function defineConfig(userConfig = {}, defaults = {}) { } // get full team info - const opts = {debug: debug.extend('get-contribs'), paths: []}; - const team = contributors !== false ? await getContributors(config.gitRoot, contributors, opts) : []; + const copts = {debug: debug.extend('get-contribs'), paths: []}; + const team = contributors !== false ? await getContributors(config.gitRoot, contributors, copts) : []; debug('discovered full team info %o', team); + // get full version alias information but let this fail + try { + const tags= await getTags(config.gitRoot, undefined, {debug: debug.extend('get-tags')}); + themeConfig.versions = tags.aliases ?? {}; + debug('discovered version aliases %o', config.versions); + } catch (error) { + debug('unable to get version alias information with error %o', error); + } + // build robots.txt and rssfeed config.buildEnd = async siteConfig => { // generate robots txt