实现切换侧边栏导航之前

This commit is contained in:
2025-08-04 13:43:54 +08:00
parent 817d184fe1
commit 631f3077f9
30 changed files with 439 additions and 47 deletions

View File

@@ -0,0 +1,52 @@
{
"hash": "b89788c1",
"configHash": "623af0bf",
"lockfileHash": "819230d2",
"browserHash": "1838b124",
"optimized": {
"vue": {
"src": "../../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "ea471cd0",
"needsInterop": false
},
"vitepress > @vue/devtools-api": {
"src": "../../../../node_modules/@vue/devtools-api/dist/index.js",
"file": "vitepress___@vue_devtools-api.js",
"fileHash": "d04dba19",
"needsInterop": false
},
"vitepress > @vueuse/core": {
"src": "../../../../node_modules/@vueuse/core/index.mjs",
"file": "vitepress___@vueuse_core.js",
"fileHash": "5b3ac246",
"needsInterop": false
},
"vitepress > @vueuse/integrations/useFocusTrap": {
"src": "../../../../node_modules/@vueuse/integrations/useFocusTrap.mjs",
"file": "vitepress___@vueuse_integrations_useFocusTrap.js",
"fileHash": "88f4fd3e",
"needsInterop": false
},
"vitepress > mark.js/src/vanilla.js": {
"src": "../../../../node_modules/mark.js/src/vanilla.js",
"file": "vitepress___mark__js_src_vanilla__js.js",
"fileHash": "cb1d3ff6",
"needsInterop": false
},
"vitepress > minisearch": {
"src": "../../../../node_modules/minisearch/dist/es/index.js",
"file": "vitepress___minisearch.js",
"fileHash": "84d2c050",
"needsInterop": false
}
},
"chunks": {
"chunk-P2XGSYO7": {
"file": "chunk-P2XGSYO7.js"
},
"chunk-HVR2FF6M": {
"file": "chunk-HVR2FF6M.js"
}
}
}

View File

@@ -3,21 +3,19 @@ import { set_sidebar } from "../utils/auto_sidebar.js";
// https://vitepress.dev/reference/site-config
export default defineConfig({
markdown: {
vue: {
compilerOptions: {
isCustomElement: () => true // 禁止解析 ${{ }}
}
}
} as any,
title: "devstar",
head: [['link', { rel: 'icon', href: '/devstar-logo.png' }]],
description: "A VitePress Site",
title: "梦宁软件",
head: [
['link', { rel: 'stylesheet', href: '/theme/style.css' }], // 引入CSS
['link', { rel: 'icon', href: '/mengninglogo.png' }] // 设置favicon
],
description: "梦宁软件",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
outlineTitle: '目录',
outline: [2, 6],
logo: '/devstar-logo.png',
logo: {
src: '/mnsoftware.png',
},
nav: [
{ text: '文档', link: '/document/index' },
{ text: 'API', link: 'https://docs.gitea.com/zh-cn/api/1.24/' },
@@ -28,7 +26,6 @@ export default defineConfig({
{
text: 'devstar是什么',
link: '/document/index',
attrs: { class: 'bold-item' }
} as any,
{
text: '安装',
@@ -163,6 +160,7 @@ export default defineConfig({
]
} as any,
{
text: '贡献',
collapsible: true, // 使整个组可折叠
collapsed: true, // 默认展开
items: [

View File

@@ -0,0 +1,22 @@
<script setup>
import { useData } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import Index from '../components/Index.vue' // 你的组件
const { Layout } = DefaultTheme
const { frontmatter } = useData()
</script>
<template>
<Layout>
<!-- 保留默认主题的所有插槽 -->
<template #home-hero>
<VPHomeHero /> <!-- 默认Hero区域 -->
<Index /> <!-- 你的自定义组件 -->
</template>
<template #home-features>
<VPHomeFeatures /> <!-- 默认Features区域 -->
</template>
</Layout>
</template>

View File

@@ -1,6 +0,0 @@
/* .vitepress/theme/custom.css */
.bold-item {
font-weight: 700 !important;
font-size: 1em !important;
/* 与其他目录项字号一致 */
}

View File

@@ -0,0 +1,5 @@
// 正确写法:继承默认主题
import DefaultTheme from 'vitepress/theme'
import './style.css' // 可选:你的自定义样式
export default DefaultTheme // ✅ 必须导出 default

View File

@@ -0,0 +1,40 @@
/* 强制覆盖主题默认的Logo尺寸 */
.VPImage.logo {
height: 150px !important;
/* 必须用 !important 覆盖主题的 !important */
width: 200px !important;
/* 固定宽度,防止变形 */
/* margin-left: 100px !important; */
margin-right: -50px !important;
margin-left: -40px !important;
}
.VPNavBar .title {
margin-right: 20px !important;
}
.VPHero .text {
font-size: 50px !important;
}
/* 移除掉目录之间的分割线 */
.group {
border-top: 0 !important;
/* padding-bottom: 0 !important; */
.items {
font-size: 20px !important;
}
}
.group .items {
font-size: 16px !important;
color: #3c3c43 !important;
font-weight: 700px !important;
}
/* .VPHero .image-container img {
width: 1000px !important;
height: 300px !important;
} */

155
docs/components/index.vue Normal file
View File

@@ -0,0 +1,155 @@
<!-- docs/index.vue -->
<template>
<div id="header">
<h2>我们的产品</h2>
<div class="product-container">
<ol class="product-list">
<!-- 产品1 -->
<li class="product-item">
<div class="product-card">
<img src="/DevStar.png" alt="产品1" class="product-image">
<div class="product-info">
<h3 class="product-title">Devstar</h3>
<p class="product-desc">DevStar Studio 是一个Gitea 发行版在Git代码仓库托管的基础上提供了开发环境DevEnv执行引擎与VS Code插件或自定义IDE深度融合形成灵活适配基础软件工具的生态平台从而为开发者用户提供智能代码大模型AI+安全完全云原生一站式开箱即用的CI/CD全生命周期研发平台</p>
<a href="/document/index" class="product-link">介绍文档</a>
</div>
</div>
</li>
<!-- 产品2 -->
<li class="product-item">
<div class="product-card">
<img src="/DevStar.png" alt="产品2" class="product-image">
<div class="product-info">
<h3 class="product-title">Devstar</h3>
<p class="product-desc">DevStar Studio 是一个Gitea 发行版在Git代码仓库托管的基础上提供了开发环境DevEnv执行引擎与VS Code插件或自定义IDE深度融合形成灵活适配基础软件工具的生态平台从而为开发者用户提供智能代码大模型AI+安全完全云原生一站式开箱即用的CI/CD全生命周期研发平台</p>
<a href="/document/index" class="product-link">介绍文档</a>
</div>
</div>
</li>
<!-- 产品3 -->
<li class="product-item">
<div class="product-card">
<img src="/DevStar.png" alt="产品3" class="product-image">
<div class="product-info">
<h3 class="product-title">Devstar</h3>
<p class="product-desc">DevStar Studio 是一个Gitea 发行版在Git代码仓库托管的基础上提供了开发环境DevEnv执行引擎与VS Code插件或自定义IDE深度融合形成灵活适配基础软件工具的生态平台从而为开发者用户提供智能代码大模型AI+安全完全云原生一站式开箱即用的CI/CD全生命周期研发平台</p>
<a href="/document/index" class="product-link">介绍文档</a>
</div>
</div>
</li>
</ol>
</div>
</div>
</template>
<script>
export default {
name: 'HomePage',
methods: {
handleClick() {
alert('按钮被点击!')
}
}
}
</script>
<style scoped>
h2 {
border-top: 0;
}
.product-container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
/* Flex布局产品列表 */
.product-list {
display: flex;
flex-wrap: wrap;
gap: 30px;
list-style: none;
padding: 0;
margin: 0;
}
/* 每个产品项 */
.product-item {
flex: 1 1 300px; /* 最小宽度300px可伸缩 */
}
/* 产品卡片 */
.product-card {
display: flex;
flex-direction: column;
align-items: center; /* 新增:使卡片内所有元素水平居中 */
height: 100%;
border: 1px solid #eaecef;
border-radius: 8px;
overflow: hidden;
transition: transform 0.3s ease;
}
.product-card:hover {
transform: translateY(-5px);
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
/* 产品图片 */
.product-image {
width: 180px; /* 根据原图比例调整 */
height: 180px;
object-fit: contain; /* 完整显示标志 */
background: transparent; /* 去除白色背景 */
padding: 0; /* 去除内边距 */
border: none !important; /* 强制去除边框 */
}
/* 产品信息区域 */
.product-info {
padding: 20px;
flex-grow: 1;
display: flex;
flex-direction: column;
}
.product-title {
margin: 0 0 10px 0;
font-size: 1.2rem;
color: #333;
}
.product-desc {
margin: 0 0 15px 0;
color: #666;
flex-grow: 1;
}
.product-link {
display: inline-block;
padding: 8px 16px;
background-color: #3eaf7c;
color: white;
text-decoration: none;
border-radius: 4px;
text-align: center;
transition: background-color 0.3s;
}
.product-link:hover {
background-color: #2d9f6b;
}
/* 响应式调整 */
@media (max-width: 768px) {
.product-list {
gap: 20px;
}
.product-item {
flex: 1 1 100%;
}
}
</style>

View File

@@ -1,12 +0,0 @@
---
date: "2016-12-01T16:00:00+02:00"
title: "Installation"
slug: "installation"
sidebar_position: 10
menu:
sidebar:
name: "Installation"
sidebar_position: 10
identifier: "installation"
---

View File

@@ -3,29 +3,39 @@
layout: home
hero:
name: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;通用的"
text: "一站式软件研发平台"
tagline: 提供开发环境DevEnv执行引擎与VS Code插件或自定义IDE深度融合形成灵活适配基础软件工具的生态平台
# name: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;通用的"
# text: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;为中小型公司提供IT服务"
text: "为中小型公司提供IT服务"
tagline: 我们为各行各业提供定制软件解决方案,为您的企业打造高价值的软件和技术
image:
src: /background.png
src: /slider1.png
alt: 背景图片
actions:
- theme: brand
text: 什么是devstar
link: /document/decription/关于devstar
text: devstar入门
link: /document/index
- theme: alt
text: 快速入门
link: /document/decription/快速开始
text: devstar入门
link: /document/index
- theme: alt
text: GitHub
link: https://github.com/mengning/DevStar
text: devstar入门
link: /document/index
features:
- title: 极易安装
details: 极易安装的详细描述
- title: 运行迅速
details: 运行迅速的详细描述
- title: 安装和使用体验良好
details: 安装和使用体验良好的详细描述
# features:
# - title: 极易安装
# details: 极易安装的详细描述
# - title: 运行迅速
# details: 运行迅速的详细描述
# - title: 安装和使用体验良好
# details: 安装和使用体验良好的详细描述
---
<script setup>
import Index from './components/Index.vue' // 你的组件
</script>
<Index/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

BIN
docs/public/mnsoftware.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

BIN
docs/public/slider1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB