Skip to content

Visualize Your Ideas With Code

fix(docs): fix broken links (#105)

Jacobf79427d58819
diff --git a/packages/docs/docs/guides/getting-started/flow.mdx b/packages/docs/docs/guides/getting-started/flow.mdx
index d8f65e49..ad2fd8b5 100644
--- a/packages/docs/docs/guides/getting-started/flow.mdx
+++ b/packages/docs/docs/guides/getting-started/flow.mdx
@@ -93,4 +93,4 @@ You can read more about them in the [tweening](/guides/getting-started/tweening)
Another kind of generators are _flow generators_. They take one or more generators as
their input and combine them together. We've mentioned the `all()` generator in
-the quickstart section, but you can find them all in [the API documentation](/core-api/modules/flow).
+the quickstart section, but you can find them all in [the API documentation](/api/core/modules/flow).
diff --git a/packages/docs/docusaurus.config.js b/packages/docs/docusaurus.config.js
index 6f033955..02a198cf 100644
--- a/packages/docs/docusaurus.config.js
+++ b/packages/docs/docusaurus.config.js
@@ -15,7 +15,6 @@ const config = {
defaultLocale: 'en',
locales: ['en'],
},
-
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
@@ -62,7 +61,7 @@ const config = {
},
{
label: 'API',
- to: 'api',
+ to: 'api/core',
},
],
},
@@ -114,7 +113,7 @@ const config = {
{
routeBasePath: '/',
sidebarPath: 'sidebars.js',
- exclude: ['**/core-api/*.md', '**/2d-api/*.md'],
+ exclude: ['**/api/core/*.md', '**/api/2d/*.md'],
showLastUpdateAuthor: true,
editUrl: ({versionDocsDirPath, docPath}) =>
`https://github.com/motion-canvas/motion-canvas/blob/main/${versionDocsDirPath}/${docPath}`,
@@ -135,7 +134,7 @@ const config = {
'docusaurus-plugin-typedoc',
{
id: 'core',
- out: 'core-api',
+ out: 'api/core',
excludeExternals: true,
entryPoints: [
'../core/',
@@ -159,7 +158,7 @@ const config = {
'docusaurus-plugin-typedoc',
{
id: '2d',
- out: '2d-api',
+ out: 'api/2d',
excludeExternals: true,
entryPoints: [
'../2d/src/components',
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 9e19938d..d2f06fdc 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -49,12 +49,12 @@ const sidebars = {
{
type: 'category',
label: 'Core',
- items: createApiSidebar('core-api'),
+ items: createApiSidebar('api/core'),
},
{
type: 'category',
label: '2D',
- items: createApiSidebar('2d-api'),
+ items: createApiSidebar('api/2d'),
},
],
};
diff --git a/packages/docs/src/components/AnimationPlayer/index.tsx b/packages/docs/src/components/AnimationPlayer/index.tsx
index 10580405..3cf38211 100644
--- a/packages/docs/src/components/AnimationPlayer/index.tsx
+++ b/packages/docs/src/components/AnimationPlayer/index.tsx
@@ -1,10 +1,14 @@
-import '@motion-canvas/player';
import type {MotionCanvasPlayerProps} from '@motion-canvas/player';
import React, {ComponentProps} from 'react';
import styles from './styles.module.css';
import AnimationLink from './AnimationLink';
+import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
import clsx from 'clsx';
+if (ExecutionEnvironment.canUseDOM) {
+ import('@motion-canvas/player');
+}
+
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace JSX {
@@ -14,7 +18,7 @@ declare global {
}
}
-export interface AnimationBannerProps {
+export interface AnimationPlayerProps {
banner?: boolean;
small?: boolean;
name: string;
@@ -24,7 +28,7 @@ export default function AnimationPlayer({
name,
banner,
small,
-}: AnimationBannerProps) {
+}: AnimationPlayerProps) {
return (
<div
className={clsx(