44import { themes as prismThemes } from 'prism-react-renderer' ;
55import type { Config } from '@docusaurus/types' ;
66import type * as Preset from '@docusaurus/preset-classic' ;
7- import logger from '@docusaurus/logger' ;
7+ // import logger from '@docusaurus/logger';
8+ import util from 'node:util' ;
9+
10+ import { redirects } from './docusaurus-config-redirects'
811
912// The node.js modules cannot be used in modules imported in browser code:
1013// webpack < 5 used to include polyfills for node.js core modules by default.
@@ -19,17 +22,17 @@ import fs from 'node:fs';
1922
2023function getCustomFields ( ) {
2124 const pwd = fileURLToPath ( import . meta. url ) ;
22- // logger.info (pwd);
25+ // console.log (pwd);
2326
2427 // First get the version from the top package.json.
2528 const topFilePath = path . join ( path . dirname ( path . dirname ( pwd ) ) , 'package.json' ) ;
26- // logger.info (filePath);
29+ // console.log (filePath);
2730 const topFileContent = fs . readFileSync ( topFilePath ) ;
2831
2932 const topPackageJson = JSON . parse ( topFileContent . toString ( ) ) ;
3033 const jsonVersion = topPackageJson . version . replace ( / [ . - ] p r e / , '' ) ;
3134
32- logger . info ( `package version: ${ topPackageJson . version } ` ) ;
35+ console . log ( `package version: ${ topPackageJson . version } ` ) ;
3336
3437 // Remove the first part, up to the last dot.
3538 const npmSubversion = jsonVersion . replace ( / ^ .* [ . ] / , '' ) ;
@@ -46,7 +49,7 @@ function getCustomFields() {
4649 let rootPackageJson
4750 try {
4851 const rootFilePath = path . join ( path . dirname ( path . dirname ( pwd ) ) , 'build-assets' , 'package.json' ) ;
49- // logger.info (filePath);
52+ // console.log (filePath);
5053 const rootFileContent = fs . readFileSync ( rootFilePath ) ;
5154 rootPackageJson = JSON . parse ( rootFileContent . toString ( ) ) ;
5255 } catch ( error ) {
@@ -81,7 +84,7 @@ function getCustomFields() {
8184// ----------------------------------------------------------------------------
8285
8386const customFields = getCustomFields ( ) ;
84- logger . info ( customFields ) ;
87+ console . log ( ' customFields: ' + util . inspect ( customFields ) ) ;
8588
8689// ----------------------------------------------------------------------------
8790
@@ -182,40 +185,7 @@ const config: Config = {
182185 [
183186 // https://docusaurus.io/docs/next/api/plugins/@docusaurus /plugin-client-redirects#redirects
184187 '@docusaurus/plugin-client-redirects' ,
185- {
186- // fromExtensions: ['html', 'htm'], // /myPage.html -> /myPage
187- // toExtensions: ['exe', 'zip'], // /myAsset -> /myAsset.zip (if latter exists)
188- redirects : [
189- // // /docs/oldDoc -> /docs/newDoc
190- // {
191- // to: '/docs/newDoc',
192- // from: '/docs/oldDoc',
193- // },
194- // // Redirect from multiple old paths to the new path
195- // {
196- // to: '/docs/newDoc2',
197- // from: ['/docs/oldDocFrom2019', '/docs/legacyDocFrom2016'],
198- // },
199- ] ,
200- createRedirects ( existingPath ) {
201- logger . info ( existingPath ) ;
202- // if (existingPath.includes('/evenimente')) {
203- // // logger.info(`to ${existingPath} from ${existingPath.replace('/evenimente', '/events')}`);
204- // // Redirect from /events/X to /evenimente/X
205- // return [
206- // existingPath.replace('/evenimente', '/events')
207- // ];
208- // } else if (existingPath.includes('/amintiri')) {
209- // // logger.info(`to ${existingPath} from ${existingPath.replace('/amintiri', '/blog')}`);
210- // // Redirect from /blog/Z to /amintiri/X
211- // return [
212- // existingPath.replace('/amintiri', '/blog')
213- // ];
214- // }
215- // return undefined; // Return a falsy value: no redirect created
216- // },
217- }
218- }
188+ redirects
219189 ] ,
220190 './src/plugins/SelectReleasesPlugin' ,
221191 ] ,
0 commit comments