@@ -4,14 +4,10 @@ import readingTime from 'reading-time';
44import { visit } from 'unist-util-visit' ;
55
66import getConfig from '../../../utils/configuration/index.mjs' ;
7- import {
8- GITHUB_EDIT_URL ,
9- populate ,
10- } from '../../../utils/configuration/templates.mjs' ;
7+ import { populate } from '../../../utils/configuration/templates.mjs' ;
118import {
129 getCompatibleVersions ,
1310 getVersionFromSemVer ,
14- getVersionURL ,
1511} from '../../../utils/generators.mjs' ;
1612import { TOC_MAX_HEADING_DEPTH } from '../constants.mjs' ;
1713
@@ -93,7 +89,7 @@ export const buildMetaBarProps = (head, entries) => {
9389 [ 'JSON' , `${ head . basename } .json` ] ,
9490 [ 'MD' , `${ head . basename } .md` ] ,
9591 ] ,
96- editThisPage : ` ${ populate ( GITHUB_EDIT_URL , config ) } ${ head . path } .md` ,
92+ editThisPage : populate ( config . editURL , { ... config , path : head . path } ) ,
9793 } ;
9894} ;
9995
@@ -107,10 +103,13 @@ export const formatVersionOptions = (compatibleVersions, path) => {
107103 const config = getConfig ( 'jsx-ast' ) ;
108104
109105 return compatibleVersions . map ( ( { version, isLts, isCurrent } ) => {
110- const parsed = getVersionFromSemVer ( version ) ;
111- const value = getVersionURL ( parsed , path , config . baseURL ) ;
106+ let label = `v${ getVersionFromSemVer ( version ) } ` ;
112107
113- let label = `v${ parsed } ` ;
108+ const value = populate ( config . pageURL , {
109+ ...config ,
110+ path,
111+ version : label ,
112+ } ) ;
114113
115114 if ( isLts ) {
116115 label += ' (LTS)' ;
0 commit comments