1
0
Эх сурвалжийг харах

docs: added netlify and remove broken links

Alvaro 2 жил өмнө
parent
commit
235768c0ca

+ 6 - 2
docs/.vitepress/theme/index.ts

@@ -11,8 +11,12 @@ export default {
     DefaultTheme.enhanceApp(ctx)
     ctx.app.component('FirstScene', FirstScene)
     ctx.app.component('StackBlitzEmbed', StackBlitzEmbed)
-    ctx.app.use(Tres)
-
+    /*  ctx.app.use(Tres)
+     */
+    if (import.meta.env.SSR) {
+      // ... server only logic
+      ctx.app.use(Tres)
+    }
     console.log(ctx)
   },
 }

+ 1 - 1
docs/examples/basic-animations.md

@@ -10,7 +10,7 @@ We will build a simple scene with a cube. We will then animate the cube to rotat
 
 The `useRenderLoop` composable is the core of TresJS animations. It allows you to register a callback that will be called every time the renderer updates the scene with the browser's refresh rate.
 
-To see a detailed explanation of how it works, please refer to the [useRenderLoop](/composables/use-render-loop) documentation.
+To see a detailed explanation of how it works, please refer to the **useRenderLoop** documentation.
 
 ```ts
 const { onLoop, resume } = useRenderLoop()

+ 2 - 2
docs/examples/load-models.md

@@ -14,7 +14,7 @@ There are several ways to load models on TresJS:
 
 The `useLoader` composable allows you to pass any type of Three.js loader and a URL to load the resource from. It returns a `Promise` with the loaded resource.
 
-For a detailed explanation of how to use `useLoader`, check out the [useLoader](/composables/use-loader) documentation.
+For a detailed explanation of how to use `useLoader`, check out the **useLoader** documentation.
 
 ```ts
 import { useLoader } from '@tresjs/core'
@@ -41,7 +41,7 @@ Notice in the example above that we are using the `Suspense` component to wrap t
 
 A more convenient way of loading models is using the `useGLTF` composable available from [@tresjs/cientos](https://github.com/Tresjs/tres/tree/main/packages/cientos) package.
 
-To learn more about `useGLTF`, check out the [useGLTF](/cientos/composables/use-gltf) documentation.
+To learn more about `useGLTF`, check out the **useGLTF** documentation.
 
 ```ts
 import { useGLTF } from '@tresjs/cientos'

+ 2 - 2
docs/examples/load-textures.md

@@ -12,7 +12,7 @@ There are two ways of loading 3D textures in TresJS:
 
 The `useLoader` composable allows you to pass any type of Three.js loader and a URL to load the resource from. It returns a `Promise` with the loaded resource.
 
-For a detailed explanation of how to use `useLoader`, check out the [useLoader](/composables/use-loader) documentation.
+For a detailed explanation of how to use `useLoader`, check out the **useLoader** documentation.
 
 ```ts
 import { useLoader } from '@tresjs/core'
@@ -42,7 +42,7 @@ Notice in the example above that we are using the `Suspense` component to wrap t
 
 A more convenient way of loading textures is using the `useTexture` composable. It accepts both an array of URLs or a single object with the texture paths mapped.
 
-To learn more about `useTexture`, check out the [useTexture](/composables/use-texture) documentation.
+To learn more about `useTexture`, check out the **useTexture** documentation.
 
 ```ts
 import { useTexture } from '@tresjs/core'

+ 3 - 3
docs/examples/orbit-controls.md

@@ -8,7 +8,7 @@ However, it is not part of the core of ThreeJS. So to use it you would need to i
 
 This creates a problem because **TresJS** automatically creates a catalog of the core of Three so you can use them as components.
 
-Fortunately, **TresJS** provides a way to extend the catalog of components. You can do it by using the `extend` method using the [useCatalogue](/composables/use-catalog) composable.
+Fortunately, **TresJS** provides a way to extend the catalog of components. You can do it by using the `extend` method using the **useCatalogue** composable.
 
 For more information about extending your TresJS catalog, refer to the [extending](/advanced/extending.md) section.
 
@@ -20,7 +20,7 @@ To use `OrbitControls` you need to import it from the `three/examples/jsm/contro
 import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'
 ```
 
-Then you need to extend the catalogue of components using the `extend` method of the [useCatalogue](/composables/use-catalog) composable.
+Then you need to extend the catalogue of components using the `extend` method of the **useCatalogue** composable.
 
 ```js
 import { useCatalogue } from '@tresjs/core'
@@ -45,7 +45,7 @@ Now you can use the `TresOrbitControls` component in your scene.
 
 Since [OrbitControls](https://threejs.org/docs/index.html?q=orbit#examples/en/controls/OrbitControls) needs a reference to the camera and the renderer, you need to pass them as arguments.
 
-You can use the [useThree](/composables/use-three) composable to get the camera and the renderer.
+You can use the **useThree** composable to get the camera and the renderer.
 
 ```ts
 import { useThree } from '@tresjs/core'

+ 3 - 2
docs/guide/index.md

@@ -1,7 +1,8 @@
 # Introduction
 
-<FirstScene style="aspect-ratio: 16/9; height: auto; margin: 2rem 0; border-radius: 8px; overflow:hidden;"/>
-
+<ClientOnly>
+    <FirstScene style="aspect-ratio: 16/9; height: auto; margin: 2rem 0; border-radius: 8px; overflow:hidden;"/>
+</ClientOnly>
 ```
 npm install three @tresjs/core -D
 ```

+ 5 - 0
netlify.toml

@@ -0,0 +1,5 @@
+[build.environment]
+  NODE_VERSION = "16"
+[build]
+  publish = "docs/.vitepress/dist"
+  command = "pnpm docs:build"