diff --git a/blog/2024-03-05-pixi-v8-launches.md b/blog/2024-03-05-pixi-v8-launches.md index 02e2859db..4ab96cbac 100644 --- a/blog/2024-03-05-pixi-v8-launches.md +++ b/blog/2024-03-05-pixi-v8-launches.md @@ -39,8 +39,8 @@ We're incredibly proud of PixiJS v8 and eager to share the improvements and new ## 🔗 Quick links - The new Docs for v8 can be found [here](https://pixijs.download/v8.0.0/docs/index.html) -- [Migration](/guides/migrations/v8) -- [Examples](/examples) +- [Migration](8.x/guides/migrations/v8) +- [Examples](8.x/examples) - [Open Games](https://github.com/pixijs/open-games) --- @@ -197,7 +197,7 @@ myContainer.blendMode = 'color-burn` // easy! ``` -For more information on these graphics upgrades and guidance on how to adapt to the enhanced Graphics API, please refer to the [migration guide](/guides/migrations/v8), or why not jump in and play with some [examples](examples/graphics/simple). +For more information on these graphics upgrades and guidance on how to adapt to the enhanced Graphics API, please refer to the [migration guide](8.x/guides/migrations/v8), or why not jump in and play with some [examples](8.x/examples/graphics/simple). #### 📝 Text Upgrades diff --git a/docusaurus.config.js b/docusaurus.config.js index d513c679a..8bad16771 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -42,19 +42,20 @@ const config = { // Remove this to remove the "edit this page" links. editUrl: 'https://github.com/pixijs/pixijs.com/tree/main/', routeBasePath: '/', + lastVersion: 'current', versions: { '7.x': { label: 'v7.x', path: '7.x', banner: 'none', - badge: false, + badge: true, }, current: { - label: 'v8.x (Latest)', - path: '', + label: 'v8.x', + path: '8.x', banner: 'none', - badge: false, + badge: true, }, }, }, @@ -74,7 +75,31 @@ const config = { ], ], - plugins: ['docusaurus-plugin-sass'], + plugins: [ + 'docusaurus-plugin-sass', + [ + '@docusaurus/plugin-client-redirects', + { + // eslint-disable-next-line consistent-return + createRedirects(existingPath) + { + if (existingPath.includes('/7.x')) return undefined; + + const pathsToRedirect = ['guides', 'examples', 'tutorials', 'playground']; + + for (let i = 0; i < pathsToRedirect.length; i++) + { + const path = pathsToRedirect[i]; + + if (existingPath.includes(`/${path}`)) + { + return [existingPath.replace(`/8.x/${path}`, `/${path}`)]; + } + } + }, + }, + ], + ], themes: [ [ @@ -122,9 +147,19 @@ const config = { ], }, { + type: 'dropdown', label: 'API', position: 'left', - href: `https://pixijs.download/release/docs/index.html`, + items: [ + { + label: 'v8.x', + href: 'https://pixijs.download/release/docs/index.html', + }, + { + label: 'v7.x', + href: 'https://pixijs.download/v7.x/docs/index.html', + }, + ], }, { type: 'doc', @@ -296,12 +331,6 @@ const config = { disableSwitch: false, respectPrefersColorScheme: true, }, - // algolia: { - // appId: 'JX6EBQCAGQ', - // apiKey: '2ac1220b913a281bcfeccdf628fa6e99', - // indexName: 'beta_pixijs', - // contextualSearch: false, - // }, }), }; diff --git a/package-lock.json b/package-lock.json index 21c6f7eb3..818857a9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,10 +10,10 @@ "dependencies": { "@codesandbox/sandpack-react": "^1.18.4", "@docusaurus/core": "~2.3.1", + "@docusaurus/plugin-client-redirects": "~2.3.1", "@docusaurus/plugin-content-blog": "~2.3.1", "@docusaurus/plugin-google-analytics": "~2.3.1", "@docusaurus/preset-classic": "~2.3.1", - "@docusaurus/theme-search-algolia": "~2.3.1", "@easyops-cn/docusaurus-search-local": "^0.35.0", "@mdx-js/react": "^1.6.22", "@monaco-editor/react": "^4.4.6", @@ -2423,17 +2423,6 @@ "react-dom": "^16.8.4 || ^17.0.0" } }, - "node_modules/@docusaurus/core/node_modules/eta": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eta/-/eta-2.0.0.tgz", - "integrity": "sha512-NqE7S2VmVwgMS8yBxsH4VgNQjNjLq1gfGU0u9I6Cjh468nPRMoDfGdK9n1p/3Dvsw3ebklDkZsFAnKJ9sefjBA==", - "engines": { - "node": ">=6.0.0" - }, - "funding": { - "url": "https://github.com/eta-dev/eta?sponsor=1" - } - }, "node_modules/@docusaurus/cssnano-preset": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/@docusaurus/cssnano-preset/-/cssnano-preset-2.3.1.tgz", @@ -2510,6 +2499,29 @@ "react-dom": "*" } }, + "node_modules/@docusaurus/plugin-client-redirects": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-2.3.1.tgz", + "integrity": "sha512-Ye0z36/L8685ni0DIxHqPPaHIXFXiSF90QYiYfpODBX6NxvvveUTyylsDBU1GQhPXPn1bd39QgaOuZ+j9gfaog==", + "dependencies": { + "@docusaurus/core": "2.3.1", + "@docusaurus/logger": "2.3.1", + "@docusaurus/utils": "2.3.1", + "@docusaurus/utils-common": "2.3.1", + "@docusaurus/utils-validation": "2.3.1", + "eta": "^2.0.0", + "fs-extra": "^10.1.0", + "lodash": "^4.17.21", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=16.14" + }, + "peerDependencies": { + "react": "^16.8.4 || ^17.0.0", + "react-dom": "^16.8.4 || ^17.0.0" + } + }, "node_modules/@docusaurus/plugin-content-blog": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-blog/-/plugin-content-blog-2.3.1.tgz", @@ -2826,17 +2838,6 @@ "react-dom": "^16.8.4 || ^17.0.0" } }, - "node_modules/@docusaurus/theme-search-algolia/node_modules/eta": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eta/-/eta-2.0.0.tgz", - "integrity": "sha512-NqE7S2VmVwgMS8yBxsH4VgNQjNjLq1gfGU0u9I6Cjh468nPRMoDfGdK9n1p/3Dvsw3ebklDkZsFAnKJ9sefjBA==", - "engines": { - "node": ">=6.0.0" - }, - "funding": { - "url": "https://github.com/eta-dev/eta?sponsor=1" - } - }, "node_modules/@docusaurus/theme-translations": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/@docusaurus/theme-translations/-/theme-translations-2.3.1.tgz", @@ -8810,6 +8811,17 @@ "node": ">=0.10.0" } }, + "node_modules/eta": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/eta/-/eta-2.2.0.tgz", + "integrity": "sha512-UVQ72Rqjy/ZKQalzV5dCCJP80GrmPrMxh6NlNf+erV6ObL0ZFkhCstWRawS85z3smdr3d2wXPsZEY7rDPfGd2g==", + "engines": { + "node": ">=6.0.0" + }, + "funding": { + "url": "https://github.com/eta-dev/eta?sponsor=1" + } + }, "node_modules/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -20792,13 +20804,6 @@ "webpack-dev-server": "^4.9.3", "webpack-merge": "^5.8.0", "webpackbar": "^5.0.2" - }, - "dependencies": { - "eta": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eta/-/eta-2.0.0.tgz", - "integrity": "sha512-NqE7S2VmVwgMS8yBxsH4VgNQjNjLq1gfGU0u9I6Cjh468nPRMoDfGdK9n1p/3Dvsw3ebklDkZsFAnKJ9sefjBA==" - } } }, "@docusaurus/cssnano-preset": { @@ -20860,6 +20865,22 @@ "react-loadable": "npm:@docusaurus/react-loadable@5.5.2" } }, + "@docusaurus/plugin-client-redirects": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-2.3.1.tgz", + "integrity": "sha512-Ye0z36/L8685ni0DIxHqPPaHIXFXiSF90QYiYfpODBX6NxvvveUTyylsDBU1GQhPXPn1bd39QgaOuZ+j9gfaog==", + "requires": { + "@docusaurus/core": "2.3.1", + "@docusaurus/logger": "2.3.1", + "@docusaurus/utils": "2.3.1", + "@docusaurus/utils-common": "2.3.1", + "@docusaurus/utils-validation": "2.3.1", + "eta": "^2.0.0", + "fs-extra": "^10.1.0", + "lodash": "^4.17.21", + "tslib": "^2.4.0" + } + }, "@docusaurus/plugin-content-blog": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-blog/-/plugin-content-blog-2.3.1.tgz", @@ -21087,13 +21108,6 @@ "lodash": "^4.17.21", "tslib": "^2.4.0", "utility-types": "^3.10.0" - }, - "dependencies": { - "eta": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eta/-/eta-2.0.0.tgz", - "integrity": "sha512-NqE7S2VmVwgMS8yBxsH4VgNQjNjLq1gfGU0u9I6Cjh468nPRMoDfGdK9n1p/3Dvsw3ebklDkZsFAnKJ9sefjBA==" - } } }, "@docusaurus/theme-translations": { @@ -25486,6 +25500,11 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" }, + "eta": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/eta/-/eta-2.2.0.tgz", + "integrity": "sha512-UVQ72Rqjy/ZKQalzV5dCCJP80GrmPrMxh6NlNf+erV6ObL0ZFkhCstWRawS85z3smdr3d2wXPsZEY7rDPfGd2g==" + }, "etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", diff --git a/package.json b/package.json index f47ee3fd6..fafc587b4 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "scripts": { - "prebuild": "npm run update-pixi-version-configs && npm run generate-content", + "prebuild": "npm run generate-content", "build": "docusaurus build", "clear": "docusaurus clear", "predeploy": "npm run generate-content", @@ -61,7 +61,7 @@ "@docusaurus/plugin-content-blog": "~2.3.1", "@docusaurus/plugin-google-analytics": "~2.3.1", "@docusaurus/preset-classic": "~2.3.1", - "@docusaurus/theme-search-algolia": "~2.3.1", + "@docusaurus/plugin-client-redirects": "~2.3.1", "@easyops-cn/docusaurus-search-local": "^0.35.0", "@mdx-js/react": "^1.6.22", "@monaco-editor/react": "^4.4.6", diff --git a/scripts/update-global-version-configs.js b/scripts/update-global-version-configs.js index 0b0c22c51..07036bdd0 100644 --- a/scripts/update-global-version-configs.js +++ b/scripts/update-global-version-configs.js @@ -79,7 +79,7 @@ recast.visit(ast, { recast.types.builders.property( 'init', recast.types.builders.identifier('path'), - recast.types.builders.literal(version.isCurrent ? '' : key), + recast.types.builders.literal(key), ), recast.types.builders.property( 'init', diff --git a/src/components/Homepage/ClosingSection/index.tsx b/src/components/Homepage/ClosingSection/index.tsx index 0d39ab898..24bb0a5f8 100644 --- a/src/components/Homepage/ClosingSection/index.tsx +++ b/src/components/Homepage/ClosingSection/index.tsx @@ -37,7 +37,7 @@ export default function ClosingSection(): JSX.Element anim="short-up-anim" style={animShortUp(0.3, 0.7)} label="Get Started" - link="/tutorials" + link="8.x/tutorials" outline={true} /> diff --git a/src/components/Homepage/HeroHeader/index.tsx b/src/components/Homepage/HeroHeader/index.tsx index 67510a24d..0463a1e23 100644 --- a/src/components/Homepage/HeroHeader/index.tsx +++ b/src/components/Homepage/HeroHeader/index.tsx @@ -16,7 +16,7 @@ export default function HeroHeader(): JSX.Element
  - +
diff --git a/src/pages/team.json b/src/pages/team.json index dedaaf68b..2676f3764 100644 --- a/src/pages/team.json +++ b/src/pages/team.json @@ -133,6 +133,6 @@ "social": { "github": "https://github.com/baseten" }, - "active": true + "active": false } ] diff --git a/tsconfig.json b/tsconfig.json index f549a341d..ba19b57e5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,7 @@ "strict": true, "target": "ESNext" }, - "exclude": ["build", "node_modules"], + "exclude": ["build", "node_modules", "*.js"], "ts-node": { "files": true, "compilerOptions": {