Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 8 additions & 2 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
# 1. 注入私钥(支持多行)
- uses: webfactory/[email protected]
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

webfactory/ssh-agent GitHub Action latest version releases

💡 Result:

Latest release: v0.9.1 — released March 17, 2024. [1][2]

Sources:
[1] webfactory/ssh-agent Releases (GitHub).
[2] Commit / CHANGELOG for v0.9.1 (GitHub).


Update webfactory/ssh-agent to the latest version.

The workflow uses webfactory/[email protected], but the latest stable version is v0.9.1 (released March 17, 2024). Update to the latest version to benefit from bug fixes and improvements.

🤖 Prompt for AI Agents
In @.github/workflows/build-docs.yml at line 28, Update the GitHub Actions step
that references the webfactory/ssh-agent action by changing its version tag from
v0.8.0 to the latest stable v0.9.1; locate the line that contains "uses:
webfactory/[email protected]" in the workflow and replace the tag so the action
runs with webfactory/[email protected] to pick up the fixes and improvements.

with:
ssh-private-key: ${{ secrets.SUBMODULE_SSH_KEY }}

# 3. 现在 checkout(含递归子模块)
Comment on lines +27 to +32
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/build-docs.yml | sed -n '25,50p'

Repository: opentiny/docs

Length of output: 1108


🌐 Web query:

webfactory/ssh-agent latest stable version 2025

💡 Result:

The latest stable release is v0.9.1 — released March 17, 2025. [1]

Sources
[1] webfactory/ssh-agent releases (GitHub).


Fix comment numbering and update SSH agent version.

The comments reference step "1" and step "3" but step "2" is missing. Renumber the steps for clarity.

Additionally, webfactory/[email protected] is outdated. Update to the latest stable version v0.9.1 (released March 17, 2025) for security best practices and bug fixes.

🤖 Prompt for AI Agents
In @.github/workflows/build-docs.yml around lines 27 - 32, The workflow comments
are misnumbered and the SSH action is outdated: change the comment that
currently reads "3. 现在 checkout(含递归子模块)" to sequentially follow the previous
comment (e.g., "2. 现在 checkout(含递归子模块)") and update the action reference string
webfactory/[email protected] to webfactory/[email protected] so the job uses the
latest stable ssh-agent release.

- name: Checkout repository (with submodules)
uses: actions/checkout@v4
with:
fetch-depth: 0 # 推荐完整历史以支持 lastUpdated 等
submodules: recursive # 检出子模块(递归)
fetch-depth: 0
submodules: false
- name: Ensure submodules are up-to-date (pull latest from their remote)
# 这一步会把子模块更新到各自远端的最新分支(通常是子模块配置的上游)
run: |
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/deploy-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SUBMODULE_SSH_KEY }}
Comment on lines +29 to +31
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/deploy-github.yml

Repository: opentiny/docs

Length of output: 2791


🌐 Web query:

webfactory/ssh-agent v0.8.0 GitHub actions

💡 Result:

Summary for webfactory/ssh-agent v0.8.0

  • Release: v0.8.0 published 24 Mar (see release notes). Main change: the action no longer writes GitHub's SSH host keys into known_hosts — users on GitHub-hosted runners need do nothing; self-hosted runners should review/fix their known_hosts. The release also updated to use actions/checkout@v3 and added options to override git/ssh-agent/ssh-add commands. [1]

  • Usage: reference the action as uses: webfactory/[email protected] and pass your SSH private key(s) via the ssh-private-key input (see README/marketplace for inputs like ssh-auth-sock and log-public-key). [2][3]

Sources
[1] webfactory/ssh-agent releases (v0.8.0).
[2] webfactory/ssh-agent README.
[3] GitHub Marketplace listing for webfactory-ssh-agent.


🌐 Web query:

actions/checkout v4 ssh-key parameter support

💡 Result:

Yes — actions/checkout@v4 supports an ssh-key input (SSH private key), plus ssh-known-hosts, ssh-strict, ssh-user, and related SSH inputs. See the official action documentation. [1][2]

Sources:

  • actions/checkout README (inputs list including ssh-key). [1]
  • GitHub Marketplace / Checkout action page (v4 description). [2]

🌐 Web query:

webfactory/ssh-agent latest version releases 2024 2025

💡 Result:

Found releases on the repository:

  • v0.9.1 — released Mar 17, 2025. [1][2]
  • v0.9.0 — released Feb 6, 2025. [1]

I did not find any releases in 2024 on the project's Releases page. [1][3]

Sources:
[1] webfactory/ssh-agent Releases (GitHub).
[2] NewReleases mirror showing v0.9.1 (2025-03-17).
[3] webfactory/ssh-agent Issues (shows activity in 2024 but no release entries).


🏁 Script executed:

rg "uses:" .github/workflows/deploy-github.yml -A 2

Repository: opentiny/docs

Length of output: 622


Update webfactory/ssh-agent to v0.9.1 (or use actions/checkout@v4's native ssh-key parameter).

The action is on v0.8.0, but v0.9.1 is available as of March 2025. More importantly, actions/checkout@v4 natively supports the ssh-key input parameter, so you can eliminate the separate ssh-agent step entirely and pass your SSH key directly to checkout:

Alternative: using native ssh-key
-      - uses: webfactory/[email protected]
-        with:
-          ssh-private-key: ${{ secrets.SUBMODULE_SSH_KEY }}
       - name: Checkout repository (with submodules)
         uses: actions/checkout@v4
         with:
           fetch-depth: 0
+          ssh-key: ${{ secrets.SUBMODULE_SSH_KEY }}
           submodules: false

If you prefer to keep the ssh-agent approach, upgrade to v0.9.1.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In @.github/workflows/deploy-github.yml around lines 29 - 31, The workflow
currently uses webfactory/[email protected] with the ssh-private-key input;
either upgrade that step to webfactory/[email protected] (replace
webfactory/[email protected] with @v0.9.1 and keep ssh-private-key: ${{
secrets.SUBMODULE_SSH_KEY }}) or remove the ssh-agent step entirely and pass the
SSH key directly to actions/checkout@v4 by adding the ssh-key input (use
actions/checkout@v4 with ssh-key: ${{ secrets.SUBMODULE_SSH_KEY }}), ensuring
you remove the now-unnecessary webfactory/ssh-agent step if you choose the
native checkout approach.

- name: Checkout repository (with submodules)
uses: actions/checkout@v4
with:
fetch-depth: 0 # 推荐完整历史以支持 lastUpdated 等
submodules: recursive # 检出子模块(递归)
submodules: false # 检出子模块(递归)

Comment on lines 32 to 37
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cd .github/workflows && pwd && cat -n deploy-github.yml

Repository: opentiny/docs

Length of output: 2828


🏁 Script executed:

cat -n .gitmodules 2>/dev/null || echo "File .gitmodules not found in root"

Repository: opentiny/docs

Length of output: 599


Fix misleading comment about submodule checkout behavior.
Line 36's comment says "检出子模块(递归)" (check out submodules recursively), but submodules: false disables submodule checkout in the actions/checkout step. Submodules are instead initialized and updated manually in the "Ensure submodules are up-to-date" step with git submodule sync --recursive, git submodule update --init --recursive, and git submodule update --remote --merge --recursive.

The .gitmodules file contains SSH URLs ([email protected]:...), which depend on the SSH key loaded via webfactory/ssh-agent—this flow is correct.

Note: The --remote --merge --recursive flags make builds non-reproducible by always tracking the latest remote HEAD of each submodule, which may not be intended for a deployment workflow. Confirm this behavior is acceptable, as it can also introduce merge conflicts if submodule branches diverge.

🤖 Prompt for AI Agents
In @.github/workflows/deploy-github.yml around lines 32 - 37, The comment next
to "submodules: false" is misleading; update the inline comment for the
actions/checkout step so it accurately reflects the behavior (e.g., "do not
checkout submodules here; submodules are initialized/updated later") or change
the setting to "submodules: true" if you intend checkout here; also ensure you
review the later manual commands (git submodule sync --recursive, git submodule
update --init --recursive, git submodule update --remote --merge --recursive)
and confirm the --remote --merge behavior is acceptable for deployment.

- name: Ensure submodules are up-to-date (pull latest from their remote)
# 这一步会把子模块更新到各自远端的最新分支(通常是子模块配置的上游)
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/deploy-obs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ jobs:
outputs:
version: ${{ steps.ver.outputs.value }}
steps:
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SUBMODULE_SSH_KEY }}
- name: Checkout repository (with submodules)
uses: actions/checkout@v4
with:
Expand Down
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 @@ -213,6 +215,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
47 changes: 15 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: 610px"
/>
</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 Expand Up @@ -753,6 +735,7 @@ watch(
align-items: center;
padding-left: 3rem;
padding-right: 3rem;
width: fit-content;
}

/* 响应式设计 */
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 faa778
Loading
Loading