Просмотр исходного кода

docs: updated docs for v1 to direct people to v2

alvarosabu 2 лет назад
Родитель
Сommit
7f0aaa9fc4

+ 4 - 0
docs/.vitepress/theme/TresLayout.vue

@@ -1,12 +1,16 @@
 <script setup>
 import DefaultTheme from 'vitepress/theme'
 import LoveVueThreeJS from './components/LoveVueThreeJS.vue'
+import UpdateBanner from './components/UpdateBanner.vue'
 
 const { Layout } = DefaultTheme
 </script>
 
 <template>
   <Layout>
+    <template #layout-top>
+      <UpdateBanner />
+    </template>
     <template #home-hero-image>
       <LoveVueThreeJS />
     </template>

+ 40 - 0
docs/.vitepress/theme/components/UpdateBanner.vue

@@ -0,0 +1,40 @@
+<script setup lang="ts"></script>
+<template>
+  <div class="update-banner">
+    You are reading Tres v1 docs. Head over <a href="https://tresjs.org/">tresjs.org</a> for V2 docs.
+  </div>
+</template>
+
+<style>
+.update-banner {
+  position: fixed;
+  width: 100%;
+  background-color: #94f7de;
+  border-bottom: 1px solid #82dbc5;
+  padding: 1rem 2rem;
+  text-align: center;
+  font-size: 0.875rem;
+  height: 64px;
+  z-index: 999;
+}
+
+.update-banner a {
+  color: #377666;
+  text-decoration: underline;
+  font-weight: 600;
+}
+
+.VPNavBar,
+.VPNav {
+  background-color: white;
+  top: 64px;
+}
+
+.VPSidebar {
+  top: 128px !important;
+}
+
+.VPContent.has-sidebar {
+  padding-top: 128px !important;
+}
+</style>

+ 7 - 3
docs/guide/getting-started.md

@@ -1,19 +1,23 @@
 # Instalation
 
+::: warning
+You’re browsing the documentation for TresJS v1. If you’re looking for the documentation for **v2**, please visit [https://tresjs.org](https://tresjs.org)
+:::
+
 Learn how to install TresJS
 
 ::: code-group
 
 ```bash [pnpm]
-pnpm add three @tresjs/core -D
+pnpm add three @tresjs/core@1.8.1 -D
 ```
 
 ```bash [npm]
-npm install three @tresjs/core -D
+npm install three @tresjs/core@1.8.1 -D
 ```
 
 ```bash [yarn]
-yarn add three @tresjs/core -D
+yarn add three @tresjs/core@1.8.1 -D
 ```
 
 :::

+ 3 - 3
docs/guide/index.md

@@ -7,15 +7,15 @@
 ::: code-group
 
 ```bash [npm]
-npm install three @tresjs/core -D
+npm install three @tresjs/core@1.8.1 -D
 ```
 
 ```bash [yarn]
-yarn add three @tresjs/core -D
+yarn add three @tresjs/core@1.8.1 -D
 ```
 
 ```bash [pnpm]
-pnpm add three @tresjs/core -D
+pnpm add three @tresjs/core@1.8.1 -D
 ```
 
 :::

+ 2 - 2
docs/index.md

@@ -1,11 +1,11 @@
 ---
 layout: home
 
-title: TresJS
+title: TresJS v1
 titleTemplate: The solution for 3D on VueJS
 
 hero:
-  name: TresJS
+  name: TresJS v1
   text: Bring Three to the Vue ecosystem
   tagline: Create awesome 3D experiences with the framework you love.
   image: