Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: website updates #90

Merged
merged 8 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions blog/2024-03-05-pixi-v8-launches.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

---
Expand Down Expand Up @@ -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

Expand Down
53 changes: 41 additions & 12 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
},
Expand All @@ -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: [
[
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -296,12 +331,6 @@ const config = {
disableSwitch: false,
respectPrefersColorScheme: true,
},
// algolia: {
// appId: 'JX6EBQCAGQ',
// apiKey: '2ac1220b913a281bcfeccdf628fa6e99',
// indexName: 'beta_pixijs',
// contextualSearch: false,
// },
}),
};

Expand Down
93 changes: 56 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion scripts/update-global-version-configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/components/Homepage/ClosingSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Homepage/HeroHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function HeroHeader(): JSX.Element
<div className="buttonRow">
<HomeCTA label="Download" link="https://github.com/pixijs/pixijs/releases" />
&nbsp;
<HomeCTA label="Get Started" link="/tutorials" white={true} outline={true} />
<HomeCTA label="Get Started" link="8.x/tutorials" white={true} outline={true} />
</div>
</div>
</header>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/team.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,6 @@
"social": {
"github": "https://github.com/baseten"
},
"active": true
"active": false
}
]
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"strict": true,
"target": "ESNext"
},
"exclude": ["build", "node_modules"],
"exclude": ["build", "node_modules", "*.js"],
"ts-node": {
"files": true,
"compilerOptions": {
Expand Down
Loading