Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "tiny-engine"]
path = tiny-engine
url = [email protected]:opentiny/tiny-engine.git
[submodule "genui-sdk"]
path = genui-sdk
url = [email protected]:opentiny/genui-sdk.git
28 changes: 23 additions & 5 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ export default defineConfig({
// 忽略死链检查(true 会跳过 VitePress 的 dead link 报错)
ignoreDeadLinks: true,
outDir: 'dist',
srcExclude: [
'**/README*.md', '**/develop-demo-en.md', '**/theme-en.md',
'tiny-vue/packages/**/*.md', 'tiny-engine/packages/**/*.md',
'tiny-robot/packages/**/*.md', 'next-sdk/packages/**/*.md',
],
srcExclude: [
'**/README*.md', '**/develop-demo-en.md', '**/theme-en.md',
'tiny-vue/packages/**/*.md', 'tiny-engine/packages/**/*.md',
'tiny-robot/packages/**/*.md', 'next-sdk/packages/**/*.md',
'genui-sdk/packages/**/*.md',
],
base: process.env.VITEPRESS_BASE || '/',
head: [['link', { rel: 'icon', href: '/images/logo-mini.svg' }]],
vite: {
Expand Down Expand Up @@ -75,6 +76,7 @@ export default defineConfig({
'tiny-robot/docs/src/:section(guide|components|tools)/:path*': 'tiny-robot/guide/:path*',
'tiny-robot/docs/src/examples/:path*': 'tiny-robot/examples/:path*',
'next-sdk/docs/:path*': 'next-sdk/:path*',
'genui-sdk/docs/src/:section(guide|api)/:path*': 'genui-sdk/guide/:path*',
'tiny-vue/examples/sites/demos/pc/webdoc/:path*': 'tiny-vue/guide/:path*',
'tiny-engine/docs/:section(getting-started|basic-features|advanced-features|tutorials)/:path*':
'tiny-engine/guide/:path*',
Expand Down Expand Up @@ -212,6 +214,22 @@ export default defineConfig({
]
}
],
'/genui-sdk/guide/': [
{
text: '介绍',
base: '/genui-sdk/guide/',
items: [
{ text: '安装指南', link: 'installation' },
]
},
{
text: 'API文档',
base: '/genui-sdk/guide/',
items: [
{ text: 'API文档', link: 'api' }
]
}
],
Comment on lines +218 to +233
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if genui-sdk submodule exists and what markdown files are present
if [ -d "genui-sdk" ]; then
  echo "=== Searching for installation.md ==="
  find genui-sdk -name "installation.md" -type f 2>/dev/null || echo "Not found"
  
  echo -e "\n=== Searching for api.md ==="
  find genui-sdk -name "api.md" -type f 2>/dev/null || echo "Not found"
  
  echo -e "\n=== All markdown files in genui-sdk (up to 2 levels) ==="
  find genui-sdk -maxdepth 3 -name "*.md" -type f 2>/dev/null | head -30
  
  echo -e "\n=== Directory structure of genui-sdk/docs (if exists) ==="
  if [ -d "genui-sdk/docs" ]; then
    ls -la genui-sdk/docs/ 2>/dev/null || echo "Cannot list"
  else
    echo "genui-sdk/docs does not exist"
  fi
else
  echo "genui-sdk submodule directory not found"
fi

Repository: opentiny/docs

Length of output: 271


🏁 Script executed:

#!/bin/bash
# Check what actually exists in the genui-sdk directory
echo "=== Contents of genui-sdk (root level) ==="
ls -la genui-sdk/ 2>/dev/null | head -20

echo -e "\n=== Directory structure (tree-like view up to 3 levels) ==="
find genui-sdk -maxdepth 3 -type d 2>/dev/null | head -20

echo -e "\n=== All files in genui-sdk (first 30 files) ==="
find genui-sdk -type f 2>/dev/null | head -30

Repository: opentiny/docs

Length of output: 330


🏁 Script executed:

#!/bin/bash
# Check if genui-sdk is a git submodule and its status
echo "=== Check git configuration for genui-sdk ==="
if [ -f ".gitmodules" ]; then
  cat .gitmodules | grep -A 5 "genui-sdk" || echo "No genui-sdk submodule entry found"
else
  echo ".gitmodules file not found"
fi

echo -e "\n=== Check git status for submodules ==="
git config --file .gitmodules --get-regexp path || echo "No submodule paths found"

echo -e "\n=== Check if any documentation exists for genui-sdk elsewhere ==="
find . -maxdepth 3 -type d -name "*genui*" 2>/dev/null | grep -v ".git"

echo -e "\n=== Check current config.mts for context (lines around 218-233) ==="
sed -n '210,240p' .vitepress/config.mts

Repository: opentiny/docs

Length of output: 1478


🏁 Script executed:

#!/bin/bash
# Check if we can verify the remote genui-sdk repository contents
# First, let's see if we can access the remote URL
echo "=== Check remote genui-sdk repository (list files via git ls-remote) ==="
git ls-remote --heads [email protected]:opentiny/genui-sdk.git 2>/dev/null | head -5

echo -e "\n=== Try to fetch submodule info using git ==="
git submodule status genui-sdk 2>/dev/null || echo "Cannot get submodule status"

echo -e "\n=== Check if there's a workaround - look at similar submodule references ==="
grep -n "'/.*-sdk/guide/'" .vitepress/config.mts | head -10

echo -e "\n=== Check if sidebar paths reference actually configured routes ==="
grep -n "'/genui-sdk" .vitepress/config.mts -A 2 -B 2

Repository: opentiny/docs

Length of output: 1123


🏁 Script executed:

#!/bin/bash
# Check the vitepress configuration more thoroughly
echo "=== Check for route definitions in config.mts ==="
grep -n "rewrite" .vitepress/config.mts -A 5 -B 2 || echo "No rewrite rules found"

echo -e "\n=== Check for publicDir or documentation source mappings ==="
grep -n "publicDir\|srcDir\|srcExclude" .vitepress/config.mts

echo -e "\n=== Check if there's a vitepress config for handling submodules ==="
grep -n "submodule\|sdk" .vitepress/config.mts | head -20

echo -e "\n=== Check vitepress docs directory structure ==="
ls -la docs/ 2>/dev/null | head -20

echo -e "\n=== Look for any genui-sdk documentation in the main docs ==="
find docs -type d -name "*genui*" 2>/dev/null || echo "No genui-sdk dir in docs"

echo -e "\n=== Check full route paths in config ==="
grep -n "^[[:space:]]*'/" .vitepress/config.mts | head -15

Repository: opentiny/docs

Length of output: 1789


🏁 Script executed:

#!/bin/bash
# Now let's verify what the actual expected file structure should be based on the rewrite rules
echo "=== Analyzing rewrite rules for genui-sdk ==="
echo "Rewrite rule: 'genui-sdk/docs/src/:section(guide|api)/:path*': 'genui-sdk/guide/:path*'"
echo ""
echo "Expected file mappings:"
echo "  installation link should map to: genui-sdk/docs/src/guide/installation.md"
echo "  api link should map to: genui-sdk/docs/src/api/api.md"
echo ""

echo "=== Check if similar patterns work in other submodules ==="
ls -la next-sdk/docs/ 2>/dev/null || echo "next-sdk/docs not found"

echo -e "\n=== List actual files in other submodules for comparison ==="
find next-sdk -maxdepth 3 -type f -name "*.md" 2>/dev/null | head -10

echo -e "\n=== Confirm genui-sdk is empty ==="
ls -la genui-sdk/ 2>/dev/null
find genui-sdk -type f 2>/dev/null | wc -l

Repository: opentiny/docs

Length of output: 642


🏁 Script executed:

#!/bin/bash
# Let's check the pattern of the sidebar configuration more carefully
echo "=== Extract the full sidebar configuration for genui-sdk ==="
sed -n '218,233p' .vitepress/config.mts

echo -e "\n=== Check vitepress rewrite rule interpretation ==="
echo "The rewrite rule pattern: 'genui-sdk/docs/src/:section(guide|api)/:path*': 'genui-sdk/guide/:path*'"
echo ""
echo "When link='installation' is clicked in route '/genui-sdk/guide/':"
echo "  - Requested path would be: /genui-sdk/guide/installation"
echo "  - This should rewrite to look for: genui-sdk/docs/src/guide/installation.md"
echo ""
echo "When link='api' is clicked in route '/genui-sdk/guide/':"
echo "  - Requested path would be: /genui-sdk/guide/api"
echo "  - This should rewrite to look for: genui-sdk/docs/src/api/api.md"

echo -e "\n=== Verify no other genui-sdk references in config ==="
grep -i "genui" .vitepress/config.mts | wc -l
grep -i "genui" .vitepress/config.mts

Repository: opentiny/docs

Length of output: 1282


The genui-sdk submodule is empty and will result in broken links.

The sidebar references files (installation.md and api.md) that do not exist in the genui-sdk submodule. The submodule directory is currently unpopulated. Based on the rewrite rule 'genui-sdk/docs/src/:section(guide|api)/:path*': 'genui-sdk/guide/:path*', the links expect:

  • genui-sdk/docs/src/guide/installation.md
  • genui-sdk/docs/src/api/api.md

Initialize the genui-sdk submodule and ensure these documentation files exist at the expected paths.

🤖 Prompt for AI Agents
In @.vitepress/config.mts around lines 218 - 233, The sidebar entry
'/genui-sdk/guide/' references non-existent docs (items '安装指南' -> 'installation'
and 'API文档' -> 'api') because the genui-sdk submodule is empty; initialize and
populate the genui-sdk submodule and add the expected markdown files matching
the rewrite rule 'genui-sdk/docs/src/:section(guide|api)/:path*' — specifically
create genui-sdk/docs/src/guide/installation.md and
genui-sdk/docs/src/api/api.md (or adjust the rewrite/sidebar if you prefer
different paths) so the sidebar links resolve.

'/tiny-vue/guide/': [
{
text: '指南',
Expand Down
4 changes: 4 additions & 0 deletions .vitepress/theme/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ const redirectMap = [
{
patterns: ['/next-sdk.html', '/next-sdk/'],
target: '/next-sdk/guide'
},
{
patterns: ['/genui-sdk.html', '/genui-sdk/', '/genui-sdk/guide.html', '/genui-sdk/guide/'],
target: '/genui-sdk/guide/installation'
}
];

Expand Down
46 changes: 14 additions & 32 deletions .vitepress/theme/components/CustomHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
:tabs="productTabs"
:activeTab="activeProductTab"
@tab-change="handleProductTabChange"
style="width: 500px"
style="width: 540px"
/>
</div>
</div>
Expand Down Expand Up @@ -286,6 +286,7 @@ import { computed, ref, onMounted, watch } from "vue";
import { useData, useRoute, useRouter } from "vitepress";
import TabNavigation from "./TabNavigation.vue";
import { normalizeLink, isActiveRoute, isHomePage } from "../utils/router";
import { NavTabFactory } from "../entity";

// 获取 VitePress 数据
const { site, theme } = useData();
Expand All @@ -312,37 +313,8 @@ const getModalTabClasses = (tab: TabItem) => ({

// 转换导航配置为TabNavigation所需格式
const navigationTabs = computed(() => {
if (
activeProductTab.value === "next-sdk" &&
route.path.includes("/next-sdk/")
) {
return [{ key: "guide", name: "使用文档", link: "/next-sdk/guide/" }];
} else if (
activeProductTab.value === "tiny-vue" &&
route.path.includes("/tiny-vue/")
) {
return [{ key: "guide", name: "使用文档", link: "/tiny-vue/guide/introduce" }];
} else {
let configNav: configNavItem[] = [];
if (
activeProductTab.value === "tiny-engine" &&
route.path.includes("/tiny-engine/")
) {
configNav = themeConfig.value.engineNav || [];
} else {
configNav = themeConfig.value.nav || [];
}
return (
configNav?.map((item: configNavItem) => ({
key:
getConfigKey(item.link) ||
item.text.toLowerCase().replace(/\s+/g, "-"),
name: item.text,
link: `${prefix}${item.link.slice(1)}`,
disabled: false,
})) || []
);
}
const navTab = NavTabFactory(activeProductTab.value, route, site, themeConfig.value);
return navTab.getTabs();
});

interface TabItem {
Expand Down Expand Up @@ -459,6 +431,14 @@ const productTabs = computed(() => [
activeProductTab.value === "next-sdk" ? "active" : "normal"
}-next-sdk.svg`,
},
{
key: "genui-sdk",
name: "GenUI-SDK",
link: `${prefix}genui-sdk/guide/installation`,
src: `${prefix}images/logo-${
activeProductTab.value === "genui-sdk" ? "active" : "normal"
}-genui-sdk.svg`,
},
Comment on lines +434 to +441
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Find all SVG files related to genui-sdk
find . -type f -name "*genui-sdk*" 2>/dev/null | head -20

Repository: opentiny/docs

Length of output: 140


🏁 Script executed:

# Check for logo files in common image directories
fd -t f "logo.*genui-sdk" . 2>/dev/null

Repository: opentiny/docs

Length of output: 140


🏁 Script executed:

# Search for genui-sdk directory structure
fd -t d "genui-sdk" . --max-depth 3 2>/dev/null

Repository: opentiny/docs

Length of output: 69


🏁 Script executed:

# Look for installation-related docs
rg "installation" -t md --files . 2>/dev/null | grep -i genui

Repository: opentiny/docs

Length of output: 39


🏁 Script executed:

# Check the CustomHeader.vue file to see the pattern of other product tabs
fd -t f "CustomHeader.vue" -exec head -n 500 {} \; | tail -n 200

Repository: opentiny/docs

Length of output: 287


🏁 Script executed:

# List the structure of genui-sdk directory
find ./genui-sdk -type f -name "*.md" | head -30

Repository: opentiny/docs

Length of output: 39


🏁 Script executed:

# Check if guide/installation exists
ls -la ./genui-sdk/guide/ 2>/dev/null || echo "guide directory not found"

Repository: opentiny/docs

Length of output: 82


🏁 Script executed:

# Look for installation-related files in genui-sdk
find ./genui-sdk -type f -name "*installation*" 2>/dev/null

Repository: opentiny/docs

Length of output: 39


🏁 Script executed:

# Check overall structure of genui-sdk
ls -la ./genui-sdk/ 2>/dev/null

Repository: opentiny/docs

Length of output: 167


🏁 Script executed:

# Check vitepress config files
fd -t f "config" .vitepress/ -e ts -e js -e mts

Repository: opentiny/docs

Length of output: 78


🏁 Script executed:

# Look at sidebar configuration
fd -t f "sidebar" . -e ts -e js -e mts

Repository: opentiny/docs

Length of output: 39


🏁 Script executed:

# Check what other product links point to (examine CustomHeader.vue more carefully)
cat -n .vitepress/theme/components/CustomHeader.vue | sed -n '400,500p'

Repository: opentiny/docs

Length of output: 3395


🏁 Script executed:

# Check if there's documentation outside genui-sdk dir
find . -type d -name "guide" | head -10

Repository: opentiny/docs

Length of output: 39


🏁 Script executed:

# Check the vitepress config
cat -n .vitepress/config.mts | head -100

Repository: opentiny/docs

Length of output: 4483


🏁 Script executed:

# Search for genui-sdk in config
rg "genui-sdk" .vitepress/config.mts

Repository: opentiny/docs

Length of output: 274


GenUI-SDK logo assets are present, but the documentation target does not exist.

The logo files exist, however, the genui-sdk documentation directory is empty. The link /genui-sdk/guide/installation (line 437) points to documentation that has not been created yet. The vitepress config is prepared to handle genui-sdk docs at genui-sdk/docs/src/guide/, but no files exist there. This creates a broken link in the navigation component.

Either create the GenUI-SDK documentation at genui-sdk/docs/src/guide/installation.md or adjust the link target to point to an existing route.

🤖 Prompt for AI Agents
In @.vitepress/theme/components/CustomHeader.vue around lines 434 - 441, The
navigation entry for the GenUI-SDK in CustomHeader.vue (the object with key
"genui-sdk" and link `${prefix}genui-sdk/guide/installation`) points to a
non-existent docs target; fix by either creating the missing documentation file
at genui-sdk/docs/src/guide/installation.md (with frontmatter and content) so
the route exists, or change the link in CustomHeader.vue to an existing route
(e.g., point to an existing product guide or the GenUI landing page) so the
navigation no longer leads to a 404; update the src/logo reference only if you
also rename the route so assets and link stay in sync.

{
key: "tiny-robot",
name: "TinyRobot",
Expand Down Expand Up @@ -502,6 +482,8 @@ watch(
const path = route.path.replace(new RegExp(`^${site.value.base}`), "/");
if (path.includes("/next-sdk/")) {
activeProductTab.value = "next-sdk";
} else if (path.includes("/genui-sdk/")) {
activeProductTab.value = "genui-sdk";
} else if (path.includes("/tiny-robot/")) {
activeProductTab.value = "tiny-robot";
} else if (path.includes("/tiny-vue/")) {
Expand Down
2 changes: 1 addition & 1 deletion .vitepress/theme/components/TabNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ onUnmounted(() => {
&__nav {
height: 100%;
display: flex;
gap: 2rem;
justify-content: space-around;
}

&__item {
Expand Down
1 change: 1 addition & 0 deletions .vitepress/theme/entity/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./nav-tab";
127 changes: 127 additions & 0 deletions .vitepress/theme/entity/nav-tab.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
interface TabItem {
key: string
name: string
link: string
}

interface configNavItem {
text: string
link: string
activeMatch?: string
}


type NavTabConstructor = new (
activeProductTab: string,
site: any,
themeConfig?: any
) => NavTab

class NavTab {
activeProductTab: string
site: any
themeConfig?: any

constructor(activeProductTab: string, site: any, themeConfig?: any) {
this.activeProductTab = activeProductTab
this.site = site
this.themeConfig = themeConfig
}

getConfigKey(link: any) {
return link.replace(/\/$/, '').split('/')[2]
}

getTabs(): TabItem[] {
const prefix = this.site.value.base || '/'
const { nav } = this.themeConfig

return (
(nav || []).map((item: configNavItem) => ({
key: this.getConfigKey(item.link) || item.text.toLowerCase().replace(/\s+/g, '-'),
name: item.text,
link: `${prefix}${item.link.slice(1)}`,
disabled: false
})) || []
)
}
}

class NextSdkNavTab extends NavTab {
constructor(activeProductTab: string, site: any, themeConfig?: any) {
super(activeProductTab, site, themeConfig)
}

getTabs(): TabItem[] {
return [{ key: 'guide', name: '使用文档', link: '/next-sdk/guide/' }]
}
}

class TinyVueNavTab extends NavTab {
constructor(activeProductTab: string, site: any, themeConfig?: any) {
super(activeProductTab, site, themeConfig)
}

getTabs(): TabItem[] {
return [{ key: 'guide', name: '使用文档', link: '/tiny-vue/guide/introduce' }]
}
}

class TinyEngineNavTab extends NavTab {
constructor(activeProductTab: string, site: any, themeConfig?: any) {
super(activeProductTab, site, themeConfig)
}

getTabs(): TabItem[] {
const prefix = this.site.value.base || '/'
const { engineNav } = this.themeConfig

return (
(engineNav || []).map((item: configNavItem) => ({
key: this.getConfigKey(item.link) || item.text.toLowerCase().replace(/\s+/g, '-'),
name: item.text,
link: `${prefix}${item.link.slice(1)}`,
disabled: false
})) || []
)
}
}

class GenuiSdkNavTab extends NavTab {
constructor(activeProductTab: string, site: any, themeConfig?: any) {
super(activeProductTab, site, themeConfig)
}

getTabs(): TabItem[] {
return [{ key: 'guide', name: '使用文档', link: '/genui-sdk/guide/installation' }]
}
}

const navTabClassMap: Record<string, NavTabConstructor> = {
'next-sdk': NextSdkNavTab,
'tiny-vue': TinyVueNavTab,
'tiny-engine': TinyEngineNavTab,
'genui-sdk': GenuiSdkNavTab,
}

const navPathMap: Record<string, string> = {
'next-sdk': '/next-sdk/',
'tiny-vue': '/tiny-vue/',
'tiny-engine': '/tiny-engine/',
'genui-sdk': '/genui-sdk/',
}

const NavTabFactory = (activeProductTab: string, route: any, site: any, themeConfig: any) => {
const isCurrentPath = (path: string) => route.path.includes(path)

const navPath = navPathMap[activeProductTab]
const NavTabClass = navTabClassMap[activeProductTab]

if (NavTabClass && isCurrentPath(navPath)) {
return new NavTabClass(activeProductTab, site, themeConfig)
}

return new NavTab(activeProductTab, site, themeConfig)
}

export { NavTabFactory }
1 change: 1 addition & 0 deletions genui-sdk
Submodule genui-sdk added at 319fe2
Loading