Skip to content

Commit

Permalink
website: updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ilg-ul committed Dec 22, 2024
1 parent 410cb2a commit 8f7a5c1
Show file tree
Hide file tree
Showing 23 changed files with 4,570 additions and 2,071 deletions.
1 change: 1 addition & 0 deletions website/blog/2021-05-24-gcc-v8-5-0-1-released.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

title: xPack GCC v8.5.0-1 released
seo_title: Version 8.5.0-1 released
description: Version 8.5.0-1 is the first release of xPack GCC.
Expand Down
1 change: 1 addition & 0 deletions website/blog/2021-10-20-gcc-v11-2-0-1-released.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

title: xPack GCC v11.2.0-1 released
seo_title: Version 11.2.0-1 released
description: Version 11.2.0-1 is a new release of xPack GCC.
Expand Down
1 change: 1 addition & 0 deletions website/blog/2022-02-11-gcc-v11-2-0-3-released.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

title: xPack GCC v11.2.0-3 released
seo_title: Version 11.2.0-3 released
description: Version 11.2.0-3 is a maintenance release of xPack GCC.
Expand Down
1 change: 1 addition & 0 deletions website/blog/2022-05-31-gcc-v11-3-0-1-released.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

title: xPack GCC v11.3.0-1 released
seo_title: Version 11.3.0-1 released
description: Version 11.3.0-1 is a new release of xPack GCC.
Expand Down
1 change: 1 addition & 0 deletions website/blog/2022-06-16-gcc-v12-1-0-1-released.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

title: xPack GCC v12.1.0-1 released
seo_title: Version 12.1.0-1 released
description: Version 12.1.0-1 is a new release of xPack GCC.
Expand Down
1 change: 1 addition & 0 deletions website/blog/2022-08-30-gcc-v12-2-0-1-released.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

title: xPack GCC v12.2.0-1 released
seo_title: Version 12.2.0-1 released
description: Version 12.2.0-1 is a new release of xPack GCC.
Expand Down
1 change: 1 addition & 0 deletions website/blog/2022-12-27-gcc-v12-2-0-2-released.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

title: xPack GCC v12.2.0-2 released
seo_title: Version 12.2.0-2 released
description: Version 12.2.0-2 is a maintenance release of xPack GCC.
Expand Down
1 change: 1 addition & 0 deletions website/blog/2023-08-31-gcc-v12-3-0-1-released.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

title: xPack GCC v12.3.0-1 released
seo_title: Version 12.3.0-1 released
description: Version 12.3.0-1 is a new release of xPack GCC.
Expand Down
1 change: 1 addition & 0 deletions website/blog/2023-08-31-gcc-v13-2-0-1-released.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

title: xPack GCC v13.2.0-1 released
seo_title: Version 13.2.0-1 released
description: Version 13.2.0-1 is a new release of xPack GCC.
Expand Down
1 change: 1 addition & 0 deletions website/blog/2023-12-05-gcc-v11-4-0-1-released.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

title: xPack GCC v11.4.0-1 released
seo_title: Version 11.4.0-1 released
description: Version 11.4.0-1 is a new release of xPack GCC.
Expand Down
1 change: 1 addition & 0 deletions website/blog/2024-02-23-gcc-v11-4-0-2-released.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

title: xPack GCC v11.4.0-2 released
seo_title: Version 11.4.0-2 released
description: Version 11.4.0-2 is a maintenance release of xPack GCC.
Expand Down
1 change: 1 addition & 0 deletions website/blog/2024-02-24-gcc-v12-3-0-2-released.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

title: xPack GCC v12.3.0-2 released
seo_title: Version 12.3.0-2 released
description: Version 12.3.0-2 is a maintenance release of xPack GCC.
Expand Down
1 change: 1 addition & 0 deletions website/blog/2024-02-24-gcc-v13-2-0-2-released.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

title: xPack GCC v13.2.0-2 released
seo_title: Version 13.2.0-2 released
description: Version 13.2.0-2 is a maintenance release of xPack GCC.
Expand Down
1 change: 1 addition & 0 deletions website/blog/2024-05-31-gcc-v14-1-0-1-released.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

title: xPack GCC v14.1.0-1 released
seo_title: Version 14.1.0-1 released
description: Version 14.1.0-1 is a new release of xPack GCC.
Expand Down
1 change: 1 addition & 0 deletions website/blog/2024-06-05-gcc-v13-3-0-1-released.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

title: xPack GCC v13.3.0-1 released
seo_title: Version 13.3.0-1 released
description: Version 13.3.0-1 is a new release of xPack GCC.
Expand Down
1 change: 1 addition & 0 deletions website/blog/2024-06-26-gcc-v12-4-0-1-released.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

title: xPack GCC v12.4.0-1 released
seo_title: Version 12.4.0-1 released
description: Version 12.4.0-1 is a new release of xPack GCC.
Expand Down
1 change: 1 addition & 0 deletions website/blog/2024-07-22-gcc-v11-5-0-1-released.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---

title: xPack GCC v11.5.0-1 released
seo_title: Version 11.5.0-1 released
description: Version 11.5.0-1 is a new release of xPack GCC.
Expand Down
74 changes: 74 additions & 0 deletions website/docusaurus-config-redirects.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* This file is part of the xPack project (http://xpack.github.io).
* Copyright (c) 2024 Liviu Ionescu. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software
* for any purpose is hereby granted, under the terms of the MIT license.
*
* If a copy of the license was not distributed with this file, it can
* be obtained from https://opensource.org/licenses/MIT/.
*/

import util from 'node:util';

export const redirects = {
// fromExtensions: ['html', 'htm'], // /myPage.html -> /myPage
// toExtensions: ['exe', 'zip'], // /myAsset -> /myAsset.zip (if latter exists)
redirects: [
// // /docs/oldDoc -> /docs/newDoc
// {
// to: '/docs/newDoc',
// from: '/docs/oldDoc',
// },
// // Redirect from multiple old paths to the new path
// {
// to: '/docs/newDoc2',
// from: ['/docs/oldDocFrom2019', '/docs/legacyDocFrom2016'],
// },

{
from: '/docs/developer-info',
to: '/docs/developer',
},
{
from: '/docs/maintainer-info',
to: '/docs/maintainer',
},
{
from: '/docs/user-info',
to: '/docs/user',
}
],
createRedirects(existingPath) {
console.log(existingPath);
// if (existingPath.includes('/evenimente')) {
// // console.log(`to ${existingPath} from ${existingPath.replace('/evenimente', '/events')}`);
// // Redirect from /events/X to /evenimente/X
// return [
// existingPath.replace('/evenimente', '/events')
// ];
// } else if (existingPath.includes('/amintiri')) {
// // console.log(`to ${existingPath} from ${existingPath.replace('/amintiri', '/blog')}`);
// // Redirect from /blog/Z to /amintiri/X
// return [
// existingPath.replace('/amintiri', '/blog')
// ];
// }
// return undefined; // Return a falsy value: no redirect created
// },

if (existingPath.includes('/user-info')) {
return [
existingPath.replace('/user-info', '/user')
];
} else if (existingPath.includes('/developer-info')) {
return [
existingPath.replace('/developer-info', '/developer')
];
} else if (existingPath.includes('/maintainer-info')) {
return [
existingPath.replace('/maintainer-info', '/maintainer')
];
}
}
}
75 changes: 10 additions & 65 deletions website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import logger from '@docusaurus/logger';
// import logger from '@docusaurus/logger';
import util from 'node:util';

import {redirects} from './docusaurus-config-redirects'

// The node.js modules cannot be used in modules imported in browser code:
// webpack < 5 used to include polyfills for node.js core modules by default.
Expand All @@ -19,17 +22,17 @@ import fs from 'node:fs';

function getCustomFields() {
const pwd = fileURLToPath(import.meta.url);
// logger.info(pwd);
// console.log(pwd);

// First get the version from the top package.json.
const topFilePath = path.join(path.dirname(path.dirname(pwd)), 'package.json');
// logger.info(filePath);
// console.log(filePath);
const topFileContent = fs.readFileSync(topFilePath);

const topPackageJson = JSON.parse(topFileContent.toString());
const jsonVersion = topPackageJson.version.replace(/[.-]pre/, '');

logger.info(`package version: ${topPackageJson.version}`);
console.log(`package version: ${topPackageJson.version}`);

// Remove the first part, up to the last dot.
const npmSubversion = jsonVersion.replace(/^.*[.]/, '');
Expand All @@ -46,7 +49,7 @@ function getCustomFields() {
let rootPackageJson
try {
const rootFilePath = path.join(path.dirname(path.dirname(pwd)), 'build-assets', 'package.json');
// logger.info(filePath);
// console.log(filePath);
const rootFileContent = fs.readFileSync(rootFilePath);
rootPackageJson = JSON.parse(rootFileContent.toString());
} catch (error) {
Expand Down Expand Up @@ -81,7 +84,7 @@ function getCustomFields() {
// ----------------------------------------------------------------------------

const customFields = getCustomFields();
logger.info(customFields);
console.log('customFields: ' + util.inspect(customFields));

// ----------------------------------------------------------------------------

Expand Down Expand Up @@ -182,65 +185,7 @@ const config: Config = {
[
// https://docusaurus.io/docs/next/api/plugins/@docusaurus/plugin-client-redirects#redirects
'@docusaurus/plugin-client-redirects',
{
// fromExtensions: ['html', 'htm'], // /myPage.html -> /myPage
// toExtensions: ['exe', 'zip'], // /myAsset -> /myAsset.zip (if latter exists)
redirects: [
// // /docs/oldDoc -> /docs/newDoc
// {
// to: '/docs/newDoc',
// from: '/docs/oldDoc',
// },
// // Redirect from multiple old paths to the new path
// {
// to: '/docs/newDoc2',
// from: ['/docs/oldDocFrom2019', '/docs/legacyDocFrom2016'],
// },
{
to: '/docs/developer',
from: '/docs/developer-info'
},
{
to: '/docs/maintainer',
from: '/docs/maintainer-info'
},
{
to: '/docs/user',
from: '/docs/user-info'
}
],
createRedirects(existingPath) {
logger.info(existingPath);
// if (existingPath.includes('/evenimente')) {
// // logger.info(`to ${existingPath} from ${existingPath.replace('/evenimente', '/events')}`);
// // Redirect from /events/X to /evenimente/X
// return [
// existingPath.replace('/evenimente', '/events')
// ];
// } else if (existingPath.includes('/amintiri')) {
// // logger.info(`to ${existingPath} from ${existingPath.replace('/amintiri', '/blog')}`);
// // Redirect from /blog/Z to /amintiri/X
// return [
// existingPath.replace('/amintiri', '/blog')
// ];
// }
// return undefined; // Return a falsy value: no redirect created
// },
if (existingPath.includes('/user-info')) {
return [
existingPath.replace('/user-info', '/user')
];
} else if (existingPath.includes('/developer-info')) {
return [
existingPath.replace('/developer-info', '/developer')
];
} else if (existingPath.includes('/maintainer-info')) {
return [
existingPath.replace('/maintainer-info', '/maintainer')
];
}
}
}
redirects
],
'./src/plugins/SelectReleasesPlugin',
],
Expand Down
Loading

0 comments on commit 8f7a5c1

Please sign in to comment.