@@ -22,6 +22,7 @@ const fileToMetadata = {};
22
22
const basePath = path . resolve ( "temp_bdr/docs/docs2/" ) ;
23
23
const imgPath = path . resolve ( "temp_bdr/docs/img/" ) ;
24
24
25
+
25
26
( async ( ) => {
26
27
const processor = unified ( )
27
28
. use ( remarkParse )
@@ -51,7 +52,7 @@ const imgPath = path.resolve("temp_bdr/docs/img/");
51
52
const mdIndex = yaml . load ( await fs . readFile ( path . resolve ( basePath , "bdr-pub.yml" ) , 'utf8' ) ) ;
52
53
53
54
const markdownToProcess = mdIndex . nav ; //await glob("temp_bdr/**/*.md");
54
- const version = mdIndex . site_name . match ( / B D R ( \d + \. \d + ) / ) [ 1 ] ;
55
+ version = mdIndex . site_name . match ( / B D R ( \d + \. \d + ) / ) [ 1 ] ;
55
56
const destPath = path . resolve ( "product_docs" , "docs" , "bdr" , version ) ;
56
57
const indexFilename = "index.md" ;
57
58
@@ -119,10 +120,17 @@ function bdrTransformer() {
119
120
if ( node . type === "jsx" && node . value . match ( / ^ < A u t h e n t i c a t e d C o n t e n t P l a c e h o l d e r / ) )
120
121
{
121
122
// todo: use HAST parser here
122
- if ( ! title )
123
- title = node . value . match ( / t o p i c = " ( [ ^ " ] + ) " / ) [ 1 ] ;
124
- description = ( node . value . match ( / d e s c r i p t i o n = " ( [ ^ " ] + ) " / ) || [ ] ) [ 1 ] ;
125
- node . value = node . value . replace ( "<AuthenticatedContentPlaceholder" , `<AuthenticatedContentPlaceholder target="https://documentation.enterprisedb.com/bdr4/release/latest/${ filename . replace ( ".md" , "/" ) } "` ) ;
123
+ if ( ! title )
124
+ {
125
+ title = node . value . match ( / t o p i c = " ( [ ^ " ] + ) " / ) [ 1 ] ;
126
+ }
127
+ description = ( node . value . match ( / d e s c r i p t i o n = " ( [ ^ " ] + ) " / ) || [ ] ) [ 1 ] ;
128
+ if ( parseFloat ( version ) < 4 )
129
+ {
130
+ node . value = node . value . replace ( "<AuthenticatedContentPlaceholder" , `<AuthenticatedContentPlaceholder target="https://documentation.2ndquadrant.com/bdr3-enterprise/release/latest/${ filename . replace ( ".md" , "/" ) } "` )
131
+ } else {
132
+ node . value = node . value . replace ( "<AuthenticatedContentPlaceholder" , `<AuthenticatedContentPlaceholder target="https://documentation.enterprisedb.com/bdr4/release/latest/${ filename . replace ( ".md" , "/" ) } "` )
133
+ }
126
134
}
127
135
}
128
136
0 commit comments