File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,13 +3,13 @@ import { lazy, Suspense } from 'preact/compat';
33import AnnouncementBanner from './AnnouncementBanner.jsx' ;
44import { loadBanners } from './loadBanners.mjs' ;
55
6- import { remoteConfig , versionMajor } from '#theme/config' ;
6+ import { remoteConfig , version } from '#theme/config' ;
77
88// TODO: Revisit SERVER global usage.
99const LazyBanners = SERVER
1010 ? null
1111 : lazy ( async ( ) => {
12- const active = await loadBanners ( remoteConfig , versionMajor ) ;
12+ const active = await loadBanners ( remoteConfig , version . major ) ;
1313
1414 if ( ! active . length ) {
1515 return { default : ( ) => null } ;
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ export default ({ metadata }) => {
5858 values = { compatibleVersions }
5959 inline = { true }
6060 className = { styles . select }
61- placeholder = { version }
61+ placeholder = { `v ${ version . version } ` }
6262 onChange = { redirect }
6363 />
6464 </ div >
Original file line number Diff line number Diff line change 11import { GlobalConfiguration } from '../../../utils/configuration/types' ;
22import { MetadataEntry } from '../../metadata/types' ;
33import { Configuration } from '../types' ;
4+ import { SemVer } from 'semver' ;
45
56declare global {
67 const SERVER : boolean ;
@@ -23,8 +24,7 @@ declare module '#theme/config' {
2324 export const useAbsoluteURLs : Configuration [ 'useAbsoluteURLs' ] ;
2425
2526 // From config generation
26- export const version : string ;
27- export const versionMajor : number ;
27+ export const version : SemVer ;
2828 export const versions : Array < {
2929 url : string ;
3030 label : string ;
Original file line number Diff line number Diff line change @@ -75,8 +75,11 @@ export function buildLanguageDisplayNameMap() {
7575export default function createConfigSource ( input ) {
7676 const { version : configVersion , ...config } = getConfig ( 'web' ) ;
7777
78- const version = `v${ configVersion . version } ` ;
79- const editURL = populate ( config . editURL , { ...config , version } ) ;
78+ const versionLabel = `v${ configVersion . version } ` ;
79+ const editURL = populate ( config . editURL , {
80+ ...config ,
81+ version : versionLabel ,
82+ } ) ;
8083 const pageURL = populate ( config . pageURL , config ) ;
8184
8285 const exports = {
@@ -85,8 +88,7 @@ export default function createConfigSource(input) {
8588 // These are keys that are large, and not needed by components, so we ignore them
8689 [ 'changelog' , 'index' , 'imports' , 'virtualImports' ]
8790 ) ,
88- version,
89- versionMajor : configVersion . major ?? null ,
91+ version : configVersion ,
9092 versions : buildVersionEntries ( config . changelog , pageURL ) ,
9193 editURL,
9294 pages : buildPageList ( input ) ,
You can’t perform that action at this time.
0 commit comments