diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 091d861..0cc595e 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -1,25 +1,25 @@
-{
- "name": "dev-vitepress",
- "image": "node:20-alpine",
-
- "customizations": {
- "vscode": {
- "settings": {},
- "extensions": [
- "vue.volar",
- "vue.vscode-typescript-vue-plugin",
- "bradlc.vscode-tailwindcss",
- "esbenp.prettier-vscode"
- ]
- }
- },
-
- "portsAttributes": {
- "5173": {
- "label": "vitepress debug",
- "onAutoForward": "notify"
- }
- },
- "postCreateCommand": "apk add git && npm install && npm add -D vitepress",
- "postAttachCommand": "npm run docs:dev"
+{
+ "name": "dev-vitepress",
+ "image": "node:20-alpine",
+
+ "customizations": {
+ "vscode": {
+ "settings": {},
+ "extensions": [
+ "vue.volar",
+ "vue.vscode-typescript-vue-plugin",
+ "bradlc.vscode-tailwindcss",
+ "esbenp.prettier-vscode"
+ ]
+ }
+ },
+
+ "portsAttributes": {
+ "5173": {
+ "label": "vitepress debug",
+ "onAutoForward": "notify"
+ }
+ },
+ "postCreateCommand": "apk add git && npm install && npm add -D vitepress",
+ "postAttachCommand": "npm run dev"
}
\ No newline at end of file
diff --git a/.gitea/workflows/mengningsoftware-docs-ci-cd.yaml b/.gitea/workflows/mengningsoftware-docs-ci-cd.yaml
index 120f633..f79a529 100644
--- a/.gitea/workflows/mengningsoftware-docs-ci-cd.yaml
+++ b/.gitea/workflows/mengningsoftware-docs-ci-cd.yaml
@@ -1,53 +1,53 @@
-name: CI/CD Pipeline for mengning.com.cn
-on:
- push:
- branches:
- - main
- pull_request:
- branches:
- - main
-
-jobs:
- build:
- runs-on: ubuntu-latest
- container:
- image: gitea/runner-images:ubuntu-latest
- steps:
- - name: 拉取代码
- uses: https://devstar.cn/actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: 安装依赖
- working-directory:
- run: |
- npm install
- npm add -D vitepress
-
- - name: 构建项目
- working-directory:
- run: |
- chmod +x node_modules/.bin/vitepress
- npm run docs:build
-
- - name: 构建 Docker 镜像
- run: |
- docker build -t devstar-docs:${{ gitea.sha }} .
-
- - name: 登录 Docker Registry 并推送镜像
- run: |
- echo "${{ secrets.DOCKER_REGISTRY_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_REGISTRY_USERNAME }} ${{ vars.DOCKER_REGISTRY_ADDRESS }} --password-stdin
- docker tag devstar-docs:${{ gitea.sha }} ${{ vars.DOCKER_REGISTRY_ADDRESS }}/devstar/devstar-studio-docs:${{ gitea.sha }}
- docker tag devstar-docs:${{ gitea.sha }} ${{ vars.DOCKER_REGISTRY_ADDRESS }}/devstar/devstar-studio-docs:latest
- docker push ${{ vars.DOCKER_REGISTRY_ADDRESS }}/devstar/devstar-studio-docs:${{ gitea.sha }}
- docker push ${{ vars.DOCKER_REGISTRY_ADDRESS }}/devstar/devstar-studio-docs:latest
-
- - name: 📝 Update mengning.com.cn
- run: |
- curl -LO https://mirrors.ustc.edu.cn/kubernetes/core%3A/stable%3A/v1.28/deb/amd64/kubectl_1.28.0-1.1_amd64.deb
- sudo dpkg -i kubectl_1.28.0-1.1_amd64.deb
- kubectl config set-cluster remote-cluster --server=${{ secrets.K8S_URL }} --insecure-skip-tls-verify=true
- kubectl config set-credentials token-user --token=${{ secrets.K8S_TOKEN }}
- kubectl config set-context remote-context --cluster=remote-cluster --user=token-user
- kubectl config use-context remote-context
+name: CI/CD Pipeline for mengning.com.cn
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ container:
+ image: gitea/runner-images:ubuntu-latest
+ steps:
+ - name: 拉取代码
+ uses: https://devstar.cn/actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: 安装依赖
+ working-directory:
+ run: |
+ npm install
+ npm add -D vitepress
+
+ - name: 构建项目
+ working-directory:
+ run: |
+ chmod +x node_modules/.bin/vitepress
+ npm run build
+
+ - name: 构建 Docker 镜像
+ run: |
+ docker build -t devstar-docs:${{ gitea.sha }} .
+
+ - name: 登录 Docker Registry 并推送镜像
+ run: |
+ echo "${{ secrets.DOCKER_REGISTRY_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_REGISTRY_USERNAME }} ${{ vars.DOCKER_REGISTRY_ADDRESS }} --password-stdin
+ docker tag devstar-docs:${{ gitea.sha }} ${{ vars.DOCKER_REGISTRY_ADDRESS }}/devstar/devstar-studio-docs:${{ gitea.sha }}
+ docker tag devstar-docs:${{ gitea.sha }} ${{ vars.DOCKER_REGISTRY_ADDRESS }}/devstar/devstar-studio-docs:latest
+ docker push ${{ vars.DOCKER_REGISTRY_ADDRESS }}/devstar/devstar-studio-docs:${{ gitea.sha }}
+ docker push ${{ vars.DOCKER_REGISTRY_ADDRESS }}/devstar/devstar-studio-docs:latest
+
+ - name: 📝 Update mengning.com.cn
+ run: |
+ curl -LO https://mirrors.ustc.edu.cn/kubernetes/core%3A/stable%3A/v1.28/deb/amd64/kubectl_1.28.0-1.1_amd64.deb
+ sudo dpkg -i kubectl_1.28.0-1.1_amd64.deb
+ kubectl config set-cluster remote-cluster --server=${{ secrets.K8S_URL }} --insecure-skip-tls-verify=true
+ kubectl config set-credentials token-user --token=${{ secrets.K8S_TOKEN }}
+ kubectl config set-context remote-context --cluster=remote-cluster --user=token-user
+ kubectl config use-context remote-context
kubectl set image deployment/devstar-docs-app devstar-docs=${{ vars.DOCKER_REGISTRY_ADDRESS }}/devstar/devstar-studio-docs:latest -n app
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 271c078..4ca90f6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,17 +1,17 @@
-# VitePress
-docs/.vitepress/dist/
-docs/.vitepress/cache/
-docs/.vitepress/.temp/
-
-# Node.js
-node_modules/
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-
-# Environment
-.env
-.env.local
-.env.development.local
-.env.test.local
+# VitePress
+.vitepress/dist/
+.vitepress/cache/
+.vitepress/.temp/
+
+# Node.js
+node_modules/
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# Environment
+.env
+.env.local
+.env.development.local
+.env.test.local
.env.production.local
\ No newline at end of file
diff --git a/docs/.vitepress/config.mts b/.vitepress/config.mts
similarity index 89%
rename from docs/.vitepress/config.mts
rename to .vitepress/config.mts
index d36410a..ab3c5e2 100644
--- a/docs/.vitepress/config.mts
+++ b/.vitepress/config.mts
@@ -1,6 +1,5 @@
import { defineConfig } from 'vitepress'
import type { DefaultTheme } from 'vitepress'
-import { set_sidebar } from "../utils/auto_sidebar.js";
// https://vitepress.dev/reference/site-config
export default defineConfig({
@@ -18,18 +17,18 @@ export default defineConfig({
src: '/mnsoftware.png',
},
nav: [
- // { text: '文档', link: '/document/index' },
+ // { text: '文档', link: '/src/document/index' },
//
- { text: 'DevStar', link: '/devstar' },
- { text: '编译加速', link: '/compile' },
- { text: '虚拟仿真', link: '/simulator' },
- { text: 'Enterprise', link: '/enterprise' },
+ { text: 'DevStar', link: '/src/devstar' },
+ { text: '编译加速', link: '/src/compile' },
+ { text: '虚拟仿真', link: '/src/simulator' },
+ { text: 'Enterprise', link: '/src/enterprise' },
],
sidebar: {
- '/devstar/': sidebarDevStar(), // 直接返回 SidebarItem[]
- '/compile/': sidebarCompiling(),
- '/simulator/': sidebarSimulator(),
- '/enterprise/': sidebarEnterprise()
+ '/src/devstar/': sidebarDevStar(), // 直接返回 SidebarItem[]
+ '/src/compile/': sidebarCompiling(),
+ '/src/simulator/': sidebarSimulator(),
+ '/src/enterprise/': sidebarEnterprise()
},
socialLinks: [
{ icon: 'github', link: ' https://github.com/mengning/DevStar' }
@@ -70,11 +69,11 @@ function sidebarDevStar(): DefaultTheme.SidebarItem[] {
return [
{
text: 'DevStar Studio',
- link: '/devstar/index',
+ link: '/src/devstar/index',
collapsible: true, // 使整个组可折叠
collapsed: false, // 默认展开
items: [
- { text: 'AI+ DevOps', link: '/devstar/ai-devops' },
+ { text: 'AI+ DevOps', link: '/src/devstar/ai-devops' },
]
} as any,
{
@@ -84,8 +83,8 @@ function sidebarDevStar(): DefaultTheme.SidebarItem[] {
items: [
{ text: '对比Gitea与其它Git托管工具', link: 'https://docs.gitea.com/zh-cn/installation/comparison' },
{ text: '数据库准备', link: 'https://docs.gitea.com/zh-cn/installation/database-prep' },
- // { text: '数据库准备', link: '/document/installation/from-source' },
- { text: '使用shell脚本安装', link: '/devstar/installation/install-via-shell-script' },
+ // { text: '数据库准备', link: '/src/document/installation/from-source' },
+ { text: '使用shell脚本安装', link: '/src/devstar/installation/install-via-shell-script' },
{ text: '使用二进制文件安装', link: 'https://docs.gitea.com/zh-cn/installation/install-from-binary' },
{ text: '包管理器安装', link: 'https://docs.gitea.com/zh-cn/installation/install-from-package' },
{ text: '使用源代码安装', link: 'https://docs.gitea.com/zh-cn/installation/install-from-source' },
@@ -239,19 +238,19 @@ function sidebarSimulator(): DefaultTheme.SidebarItem[] {
return [
{
text: '虚拟仿真技术',
- link: '/simulator/index',
+ link: '/src/simulator/index',
items: [
]
},
{
text: '虚拟ECU',
- link: '/simulator/vECU',
+ link: '/src/simulator/vECU',
items: [
]
} as any,
{
text: '整车系统级软硬件联合仿真',
- link: '/simulator/vehicle-simulator',
+ link: '/src/simulator/vehicle-simulator',
items: []
},
]
@@ -261,7 +260,7 @@ function sidebarCompiling(): DefaultTheme.SidebarItem[] {
return [
{
text: '编译加速',
- link: '/compile/index',
+ link: '/src/compile/index',
items: [
]
@@ -273,15 +272,15 @@ function sidebarCompiling(): DefaultTheme.SidebarItem[] {
items: [
{
text: '为什么需要分布式编译?',
- link: '/compile/why-distributed-compiling'
+ link: '/src/compile/why-distributed-compiling'
},
{
text: 'CloudBuild',
- link: '/compile/cloudbuild'
+ link: '/src/compile/cloudbuild'
},
{
text: 'ShareBuild',
- link: '/compile/sharebuild'
+ link: '/src/compile/sharebuild'
},
]
} as any,
@@ -292,15 +291,15 @@ function sidebarCompiling(): DefaultTheme.SidebarItem[] {
items: [
{
text: 'AI Compiler简介',
- link: '/compile/why-distributed-compiling'
+ link: '/src/compile/why-distributed-compiling'
},
{
text: 'CloudBuild',
- link: '/compile/cloudbuild'
+ link: '/src/compile/cloudbuild'
},
{
text: 'ShareBuild',
- link: '/compile/sharebuild'
+ link: '/src/compile/sharebuild'
},
]
} as any,
@@ -311,15 +310,15 @@ function sidebarCompiling(): DefaultTheme.SidebarItem[] {
items: [
{
text: 'PGO/LTO简介',
- link: '/compile/why-distributed-compiling'
+ link: '/src/compile/why-distributed-compiling'
},
{
text: 'CloudBuild',
- link: '/compile/cloudbuild'
+ link: '/src/compile/cloudbuild'
},
{
text: 'ShareBuild',
- link: '/compile/sharebuild'
+ link: '/src/compile/sharebuild'
},
]
},
@@ -330,14 +329,14 @@ function sidebarEnterprise(): DefaultTheme.SidebarItem[] {
return [
{
text: 'DevStar Enterprise',
- link: '/enterprise/index',
+ link: '/src/enterprise/index',
items: [
]
},
{
text: '常见问题FAQ',
- link: '/enterprise/faq',
+ link: '/src/enterprise/faq',
items: []
},
]
diff --git a/docs/.vitepress/theme/index.js b/.vitepress/theme/index.js
similarity index 100%
rename from docs/.vitepress/theme/index.js
rename to .vitepress/theme/index.js
diff --git a/docs/.vitepress/theme/style.css b/.vitepress/theme/style.css
similarity index 100%
rename from docs/.vitepress/theme/style.css
rename to .vitepress/theme/style.css
diff --git a/Dockerfile b/Dockerfile
index 06903bf..12b9e0a 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,21 +1,21 @@
-# 第一阶段:node镜像打包
-FROM node:20-alpine AS frontend-builder
-WORKDIR /build-app
-COPY . .
-RUN npm install
-RUN npm add -D vitepress
-RUN npm run docs:build
-
-# 第二阶段:nginx打包
-FROM nginx:1.25-alpine
-EXPOSE 80
-WORKDIR /app
-# 替换nginx配置
-COPY nginx.conf /etc/nginx/conf.d/default.conf
-# 将第一阶段的静态文件复制到nginx中
-RUN rm -rf /usr/share/nginx/html
-RUN mkdir /usr/share/nginx/html
-COPY --from=frontend-builder /build-app/docs/.vitepress/dist /usr/share/nginx/html
-
-# 运行
-CMD ["nginx", "-g", "daemon off;"]
+# 第一阶段:node镜像打包
+FROM node:20-alpine AS frontend-builder
+WORKDIR /build-app
+COPY . .
+RUN npm install
+RUN npm add -D vitepress
+RUN npm run build
+
+# 第二阶段:nginx打包
+FROM nginx:1.25-alpine
+EXPOSE 80
+WORKDIR /app
+# 替换nginx配置
+COPY nginx.conf /etc/nginx/conf.d/default.conf
+# 将第一阶段的静态文件复制到nginx中
+RUN rm -rf /usr/share/nginx/html
+RUN mkdir /usr/share/nginx/html
+COPY --from=frontend-builder /build-app/.vitepress/dist /usr/share/nginx/html
+
+# 运行
+CMD ["nginx", "-g", "daemon off;"]
diff --git a/README.md b/README.md
index 1d36037..73d0d0f 100644
--- a/README.md
+++ b/README.md
@@ -1,31 +1,31 @@
-# 梦宁软件官网及DevStar文档
-
-## 配置开发环境
-
-```md
-npm install
-npm add -D vitepress
-```
-
-## 如何启动调试项目
-```md
-npm run docs:dev
-```
-## 如何打包项目
-```md
-npm run docs:build
-```
-## 如何预览打包的项目
-```md
-npm run docs:preview
-```
-## 如何添加或修改侧边栏
-在docs/.vitepress/config.mts中的sidebar进行修改,对于不同路径下的侧边栏,分别使用不同函数得到,text为侧边栏的描述内容,link为点击侧边栏后加载的内容的链接,如果有子目录,在items进行修改
-
-link链接的内容既可以是网页链接,也可以是本地文档
-## 如何自定义网站样式
-在docs/.vitepress/theme/style.css中自定义网站样式
-
-## 如何添加或修改导航栏
-在docs/.vitepress/config.mts中的nav进行修改
-
+# 梦宁软件官网及DevStar文档
+
+## 配置开发环境
+
+```md
+npm install
+npm add -D vitepress
+```
+
+## 如何启动调试项目
+```md
+npm run dev
+```
+## 如何打包项目
+```md
+npm run build
+```
+## 如何预览打包的项目
+```md
+npm run preview
+```
+## 如何添加或修改侧边栏
+在docs/.vitepress/config.mts中的sidebar进行修改,对于不同路径下的侧边栏,分别使用不同函数得到,text为侧边栏的描述内容,link为点击侧边栏后加载的内容的链接,如果有子目录,在items进行修改
+
+link链接的内容既可以是网页链接,也可以是本地文档
+## 如何自定义网站样式
+在docs/.vitepress/theme/style.css中自定义网站样式
+
+## 如何添加或修改导航栏
+在docs/.vitepress/config.mts中的nav进行修改
+
diff --git a/docs/utils/auto_sidebar.js b/docs/utils/auto_sidebar.js
deleted file mode 100644
index d5dea4c..0000000
--- a/docs/utils/auto_sidebar.js
+++ /dev/null
@@ -1,65 +0,0 @@
-import path from "node:path";
-import fs from "node:fs";
-
-const DIR_PATH = path.resolve("docs");
-const WHITE_LIST = ["index.md", ".vitepress", "node_modules", ".idea", "assets", "public"];
-
-const isDirectory = (path) => fs.lstatSync(path).isDirectory();
-const intersections = (arr1, arr2) =>
- Array.from(new Set(arr1.filter((item) => !new Set(arr2).has(item))));
-
-// 新增:按文件系统原始顺序排序
-const keepOriginalOrder = (files, dirPath) => {
- return files
- .map(file => ({
- name: file,
- time: fs.statSync(path.join(dirPath, file)).birthtimeMs // 获取创建时间戳
- }))
- .sort((a, b) => a.time - b.time) // 按创建时间排序
- .map(item => item.name);
-};
-
-function getList(params, path1, pathname) {
- const res = [];
-
- // 修改点1:使用 keepOriginalOrder 保持原始顺序
- const orderedParams = keepOriginalOrder(params, path1);
-
- for (let file of orderedParams) { // 修改点2:改用 for...of 遍历
- const dir = path.join(path1, file);
- const isDir = isDirectory(dir);
-
- if (isDir) {
- const files = fs.readdirSync(dir);
- res.push({
- text: file,
- collapsible: true,
- items: getList(files, dir, `${pathname}/${file}`),
- });
- } else {
- const suffix = path.extname(file);
- if (suffix !== ".md") continue;
-
- const name = path.basename(file, '.md');
- res.push({
- text: name,
- link: `${pathname}/${name}`,
- });
- }
- }
-
- // 修改点3:完全移除 sort() 调用
- return res;
-}
-
-export const set_sidebar = (pathname) => {
- try {
- const dirPath = path.join(DIR_PATH, pathname);
- const files = fs.readdirSync(dirPath);
- const items = intersections(files, WHITE_LIST);
- return getList(items, dirPath, pathname);
- } catch (error) {
- console.error(`Error generating sidebar for ${pathname}:`, error);
- return [];
- }
-};
\ No newline at end of file
diff --git a/docs/index.md b/index.md
similarity index 92%
rename from docs/index.md
rename to index.md
index e94b56c..733c184 100644
--- a/docs/index.md
+++ b/index.md
@@ -30,7 +30,7 @@ hero:
# details: 安装和使用体验良好的详细描述
---