Skip to content

Harness engineering beginner tutorial, from 0 to 1

style: replace text redirecting with a spinner

sanbuphyab7d29926131
diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts
index c627d35..7e250ee 100644
--- a/docs/.vitepress/config.mts
+++ b/docs/.vitepress/config.mts
@@ -2,7 +2,7 @@
import { defineConfig } from "vitepress";
import { withMermaid } from "vitepress-plugin-mermaid";
-const docsBase = process.env.DOCS_BASE_PATH ?? "/";
+const docsBase = "/learn-harness-engineering/";
const zhLectureItems = [
{ text: "欢迎", link: "/zh/" },
@@ -121,9 +121,9 @@ export default withMermaid(
{ text: "Try Harness ↗", link: "https://github.com/walkinglabs/learn-harness-engineering/blob/main/docs/en/resources/templates/index.md", target: "_blank", rel: "noopener noreferrer" }
],
sidebar: {
- '/en/projects/': { base: '/en/projects/', items: enProjectItems },
- '/en/resources/': { base: '/en/resources/', items: enResourceItems },
- '/en/': { base: '/en/', items: enLectureItems }
+ '/en/projects/': [{ text: "Projects", items: enProjectItems }],
+ '/en/resources/': [{ text: "Resource Library", items: enResourceItems }],
+ '/en/': [{ text: "Lectures", items: enLectureItems }]
},
socialLinks: [{ icon: "github", link: "https://github.com/walkinglabs/learn-harness-engineering" }]
}
@@ -140,10 +140,10 @@ export default withMermaid(
{ text: "Try Harness ↗", link: "https://github.com/walkinglabs/learn-harness-engineering/blob/main/docs/zh/resources/templates/index.md", target: "_blank", rel: "noopener noreferrer" }
],
sidebar: {
- '/zh/projects/': { base: '/zh/projects/', items: zhProjectItems },
- '/zh/resources/': { base: '/zh/resources/', items: zhResourceItems },
- '/zh/': { base: '/zh/', items: zhLectureItems }
- },
+ '/zh/projects/': [{ text: "项目", items: zhProjectItems }],
+ '/zh/resources/': [{ text: "资料库", items: zhResourceItems }],
+ '/zh/': [{ text: "讲义", items: zhLectureItems }]
+ },
outline: {
level: [2, 3]
},
diff --git a/docs/index.md b/docs/index.md
index d5149ba..8fca504 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -13,14 +13,34 @@ if (typeof window !== 'undefined') {
}
</script>
-# Learn Harness Engineering
+<style>
+.redirecting-wrapper {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 60vh;
+ font-family: var(--vp-font-family-base);
+ color: var(--vp-c-text-2);
+}
+
+.spinner {
+ width: 40px;
+ height: 40px;
+ border: 3px solid var(--vp-c-bg-alt);
+ border-top-color: var(--vp-c-brand-1);
+ border-radius: 50%;
+ animation: spin 1s linear infinite;
+ margin: 0 auto 16px auto;
+}
-Redirecting...
+@keyframes spin {
+ to { transform: rotate(360deg); }
+}
+</style>
-<template>
-<p>Choose your language / 选择语言:</p>
-<ul>
- <li><a href="./zh/">中文</a></li>
- <li><a href="./en/">English</a></li>
-</ul>
-</template>
+<div class="redirecting-wrapper">
+ <div style="text-align: center;">
+ <div class="spinner"></div>
+ <p>Loading...</p>
+ </div>
+</div>