Skip to content

Commit a7d4dff

Browse files
authored
feat: modify image path and replace image (#42)
* fix: fix the issue where the path cannot be found * feat: modify image path and replace image
1 parent 09f09a0 commit a7d4dff

38 files changed

+38
-34
lines changed

.vitepress/config.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default defineConfig({
3838
outDir: 'dist',
3939
srcExclude: ['**/README*.md','**/develop-demo-en.md','**/theme-en.md'],
4040
base: process.env.VITEPRESS_BASE || '/',
41-
head: [['link', { rel: 'icon', href: '/logo-mini.svg' }]],
41+
head: [['link', { rel: 'icon', href: '/images/logo-mini.svg' }]],
4242
vite: {
4343
// 允许以大写扩展名结尾的图片/静态资源被当作资产处理,避免被 import-analyze 当作 JS 解析
4444
assetsInclude: ['**/*.{png,PNG,jpg,JPG,jpeg,JPEG,gif,GIF,webp,WEBP,svg,SVG}'],
@@ -69,7 +69,7 @@ export default defineConfig({
6969
},
7070
themeConfig: {
7171
// https://vitepress.dev/reference/default-theme-config
72-
logo: '/logo-mini.svg',
72+
logo: '/images/logo-mini.svg',
7373
siteTitle: 'OpenTiny NEXT',
7474
nav: [
7575
{ text: '指南', link: '/tiny-robot/guide/quick-start', activeMatch: '/guide/' },

.vitepress/theme/components/CustomHeader.vue

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<img
1010
:src="
1111
isDark
12-
? '/logo-opentiny-next-text-dark.svg'
13-
: '/logo-opentiny-next-text.svg'
12+
? '/images/logo-opentiny-next-text-dark.svg'
13+
: '/images/logo-opentiny-next-text.svg'
1414
"
1515
alt="OpenTiny NEXT"
1616
class="logo-icon"
@@ -138,8 +138,8 @@
138138
<img
139139
:src="
140140
isDark
141-
? '/logo-opentiny-next-text-dark.svg'
142-
: '/logo-opentiny-next-text.svg'
141+
? '/images/logo-opentiny-next-text-dark.svg'
142+
: '/images/logo-opentiny-next-text.svg'
143143
"
144144
alt="OpenTiny NEXT"
145145
class="logo-icon"
@@ -455,29 +455,33 @@ const productTabs = computed(() => [
455455
key: "next-sdk",
456456
name: "NEXT-SDKs",
457457
link: `${prefix}next-sdk/guide`,
458-
src: `${prefix}logo-${
458+
src: `${prefix}images/logo-${
459459
activeProductTab.value === "next-sdk" ? "active" : "normal"
460460
}-next-sdk.svg`,
461461
},
462462
{
463463
key: "tiny-robot",
464464
name: "TinyRobot",
465465
link: `${prefix}tiny-robot/guide/quick-start`,
466-
src: `${prefix}logo-${
466+
src: `${prefix}images/logo-${
467467
activeProductTab.value === "tiny-robot" ? "active" : "normal"
468468
}-tiny-robot.svg`,
469469
},
470470
{
471471
key: "tiny-vue",
472472
name: "TinyVue",
473473
link: `${prefix}tiny-vue/guide/envpreparation-open`,
474-
src: `${prefix}logo-active-next-sdk.svg`,
474+
src: `${prefix}images/logo-${
475+
activeProductTab.value === "tiny-vue" ? "active" : "normal"
476+
}-tiny-vue.svg`,
475477
},
476478
{
477479
key: "tiny-engine",
478480
name: "TinyEngine",
479481
link: `${prefix}tiny-engine/engines/introduction`,
480-
src: `${prefix}logo-active-next-sdk.svg`,
482+
src: `${prefix}images/logo-${
483+
activeProductTab.value === "tiny-engine" ? "active" : "normal"
484+
}-tiny-engine.svg`,
481485
},
482486
]);
483487

.vitepress/theme/home/index.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const nextDates = [
7171
{
7272
nextDateLeft: [
7373
{
74-
icon: '/logo-active-next-sdk.svg',
74+
icon: '/images/logo-active-next-sdk.svg',
7575
title: 'NEXT-SDKs',
7676
desc: 'OpenTiny NEXT-SDKs 是一套前端智能应用开发工具包,旨在简化 WebAgent 的集成与使用,支持多种编程语言和前端框架,帮助开发者快速实现智能化功能。'
7777
},
@@ -92,8 +92,8 @@ const nextDates = [
9292
title: '快速开始',
9393
desc: '使用 OpenTiny NEXT-SDKs,只需要以下四步,就可以把你的前端应用变成智能应用。',
9494
links: [
95-
{ text: '让你的应用智能化',icon: '/icon-app.svg', url: '/next-sdk/guide/#让你的应用智能化' },
96-
{ text: '浏览器直接引入',icon: '/icon-browser.svg', url: '/next-sdk/guide/#浏览器直接引入' },
95+
{ text: '让你的应用智能化',icon: '/images/icon-app.svg', url: '/next-sdk/guide/#让你的应用智能化' },
96+
{ text: '浏览器直接引入',icon: '/images/icon-browser.svg', url: '/next-sdk/guide/#浏览器直接引入' },
9797
]
9898
},
9999
{
@@ -111,7 +111,7 @@ const nextDates = [
111111
nextDateLeft: [
112112
{
113113
title: 'TinyRobot',
114-
icon: '/logo-active-tiny-robot.svg',
114+
icon: '/images/logo-active-tiny-robot.svg',
115115
desc: 'TinyRobot是符合OpenTiny Design 设计体系的 AI 组件库,提供了丰富的AI交互组件,助力开发者快速构建AI应用。'
116116
},
117117
{
@@ -140,8 +140,8 @@ const nextDates = [
140140
title: '指南',
141141
desc: 'TinyRobot是符合OpenTiny Design 设计体系的 AI 组件库,提供了丰富的AI交互组件,助力开发者快速构建AI应用。',
142142
links: [
143-
{ text: '安装',icon: '/icon-tool.svg', url: '/tiny-robot/guide/quick-start.html#安装' },
144-
{ text: '引入与使用',icon: '/icon-download.svg', url: '/tiny-robot/guide/usage.html#引入与使用' },
143+
{ text: '安装',icon: '/images/icon-tool.svg', url: '/tiny-robot/guide/quick-start.html#安装' },
144+
{ text: '引入与使用',icon: '/images/icon-download.svg', url: '/tiny-robot/guide/usage.html#引入与使用' },
145145
]
146146
},
147147
{

.vitepress/theme/style.css

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -345,16 +345,16 @@ a.result:hover .titles .title .text mark{
345345
width: 24px;
346346
background-size: 16px 16px;
347347
opacity: 1;
348-
background-image: url("../../public/icon-copy.svg");
348+
background-image: url("../../public/images/icon-copy.svg");
349349
}
350350
.vp-doc .vp-adaptive-theme button.copy.copied {
351-
background-image: url("../../public/icon-check-mark.svg");
351+
background-image: url("../../public/images/icon-check-mark.svg");
352352
}
353353
.vp-doc .vp-adaptive-theme button.copy.copied:hover {
354-
background-image: url("../../public/icon-check-mark.svg");
354+
background-image: url("../../public/images/icon-check-mark.svg");
355355
}
356356
.vp-doc .vp-adaptive-theme button.copy:hover{
357-
background-image: url("../../public/icon-copy-hover.svg");
357+
background-image: url("../../public/images/icon-copy-hover.svg");
358358
}
359359

360360
.vp-doc .vp-adaptive-theme button.copy.copied::before ,.vp-doc .vp-adaptive-theme button.copy:hover.copied::before {
@@ -415,7 +415,7 @@ info{
415415
width: 100%;
416416
}
417417
.vp-doc .header-anchor:before{
418-
content: url("../../public/header-anchor.svg");
418+
content: url("../../public/images/header-anchor.svg");
419419
margin-bottom: 10px;
420420
}
421421
.vp-doc .header-anchor{
@@ -468,7 +468,7 @@ info{
468468
width: 12px;
469469
height: 12px;
470470
margin-right: 8px;
471-
background-image: url("../../public/icon-lists.svg");
471+
background-image: url("../../public/images/icon-lists.svg");
472472
background-repeat: no-repeat;
473473
background-size: contain; /* 或用 '12px 12px' 精确控制 */
474474
background-position: center;
@@ -526,16 +526,16 @@ info{
526526
transform: translateY(0); /* 需要微调时改为 translateY(1px) / -1px */
527527
}
528528
.vp-doc .custom-block.info::before {
529-
content: url("../../public/icon-info.svg");
529+
content: url("../../public/images/icon-info.svg");
530530
}
531531
.vp-doc .custom-block.warning::before {
532-
content: url("../../public/icon-warning.svg");
532+
content: url("../../public/images/icon-warning.svg");
533533
}
534534
.vp-doc .custom-block.danger::before {
535-
content: url("../../public/icon-error.svg");
535+
content: url("../../public/images/icon-error.svg");
536536
}
537537
.vp-doc .custom-block.tip::before {
538-
content: url("../../public/icon-success.svg");
538+
content: url("../../public/images/icon-success.svg");
539539
}
540540

541541
/* 暗色模式下全局样式 */
@@ -638,14 +638,14 @@ info{
638638
background-color: #1476FF;
639639
}
640640
.dark .vp-doc .vp-adaptive-theme button.copy {
641-
background-image: url("../../public/icon-copy-dark.svg");
641+
background-image: url("../../public/images/icon-copy-dark.svg");
642642

643643
}
644644
.dark .vp-doc .vp-adaptive-theme button.copy:hover{
645-
background-image: url("../../public/icon-copy-dark-hover.svg");
645+
background-image: url("../../public/images/icon-copy-dark-hover.svg");
646646
}
647647
.dark .vp-doc .vp-adaptive-theme button.copy.copied ,.dark .vp-doc .vp-adaptive-theme button.copy.copied:hover {
648-
background-image: url("../../public/icon-check-mark.svg");
648+
background-image: url("../../public/images/icon-check-mark.svg");
649649
}
650650
.dark a.result:hover{
651651
background-color: #1a1a1a;
@@ -664,7 +664,7 @@ info{
664664
border: 1px solid rgba(255, 255, 255, 0.2);
665665
}
666666
.dark .outline-title::before {
667-
background-image: url("../../public/icon-lists-dark.svg");
667+
background-image: url("../../public/images/icon-lists-dark.svg");
668668
}
669669
.dark .vp-doc .custom-block.info{
670670
background: rgba(82, 145, 255, 0.1);
@@ -687,16 +687,16 @@ info{
687687
color: #5ba854;
688688
}
689689
.dark .vp-doc .custom-block.info::before {
690-
content: url("../../public/icon-info-dark.svg");
690+
content: url("../../public/images/icon-info-dark.svg");
691691
}
692692
.dark .vp-doc .custom-block.warning::before {
693-
content: url("../../public/icon-warning-dark.svg");
693+
content: url("../../public/images/icon-warning-dark.svg");
694694
}
695695
.dark .vp-doc .custom-block.danger::before {
696-
content: url("../../public/icon-error-dark.svg");
696+
content: url("../../public/images/icon-error-dark.svg");
697697
}
698698
.dark .vp-doc .custom-block.tip::before {
699-
content: url("../../public/icon-success-dark.svg");
699+
content: url("../../public/images/icon-success-dark.svg");
700700
}
701701
/* ===== 响应式布局 ===== */
702702
@media (min-width: 980px) {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)