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

Version aliases #62

Merged
merged 2 commits into from
Nov 7, 2024
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [[email protected].](https://github.com/vuejs/vitepress/blob/main/CHANGELOG.md)
* Updated to [[email protected].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)

Expand Down
14 changes: 12 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
Expand Down
Loading