Skip to content

Commit 2824ba8

Browse files
committed
feat: init vitepress
1 parent 2e99d6c commit 2824ba8

26 files changed

+2673
-6833
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ coverage.lcov
66
.wechatide
77
.cache
88
.temp
9-
docs/.vuepress/dist
9+
docsback/.vuepress/dist
10+
11+
docs/.vitepress/dist
12+
docs/.vitepress/cache
1013

1114
#///////////////////////////
1215
# Cocos Creator 3D Project

docs/.vitepress/config.mts

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
import { defineConfig } from 'vitepress'
2+
3+
// https://vitepress.dev/reference/site-config
4+
export default defineConfig({
5+
title: "Layout",
6+
description: "轻量级 Canvas2d 渲染引擎",
7+
base: "/minigame-canvas-engine/",
8+
head: [
9+
// meta
10+
["meta", { name: "robots", content: "all" }],
11+
["meta", { name: "author", content: "yuanzm" }],
12+
["meta", { name: "keywords", content: "minigame-canvans-engine, minigame, canvas, engine, game engine" }],
13+
['link', { rel: 'shortcut icon', type: "image/x-icon", href: `./imgs/favicon.ico` }],
14+
// [
15+
// 'script',
16+
// { id: 'statcounter' },
17+
// `
18+
// var sc_project=12873270;
19+
// var sc_invisible=1;
20+
// var sc_security="efed24b4";
21+
// `
22+
// ],
23+
// ["script", { src: "https://www.statcounter.com/counter/counter.js", async: "true" }]
24+
],
25+
26+
27+
themeConfig: {
28+
search: {
29+
provider: 'local',
30+
options: {
31+
translations: {
32+
button: {
33+
buttonText: '搜索',
34+
buttonAriaLabel: '搜索'
35+
},
36+
modal: {
37+
displayDetails: '显示详细列表',
38+
resetButtonTitle: '重置搜索',
39+
backButtonTitle: '关闭搜索',
40+
noResultsText: '没有结果',
41+
footer: {
42+
selectText: '选择',
43+
selectKeyAriaLabel: '输入',
44+
navigateText: '导航',
45+
navigateUpKeyAriaLabel: '上箭头',
46+
navigateDownKeyAriaLabel: '下箭头',
47+
closeText: '关闭',
48+
closeKeyAriaLabel: 'esc'
49+
}
50+
}
51+
},
52+
}
53+
},
54+
lastUpdated: {
55+
text: '上次更新',
56+
formatOptions: {
57+
dateStyle: 'full',
58+
timeStyle: 'medium'
59+
}
60+
},
61+
outline: {
62+
label: '页面导航'
63+
},
64+
// https://vitepress.dev/reference/default-theme-config
65+
nav: [
66+
{
67+
text: "微信小游戏官方文档",
68+
link: "https://developers.weixin.qq.com/minigame/dev/guide/",
69+
},
70+
],
71+
72+
sidebar: [
73+
{
74+
text: "概览",
75+
link: "/index"
76+
},
77+
78+
{
79+
text: "安装使用",
80+
link: '/overview/guide',
81+
items: [
82+
{ text: '快速入门', link: '/overview/guide'},
83+
{ text: '微信小游戏插件', link: '/overview/plugin'}
84+
]
85+
},
86+
{
87+
text: '教程',
88+
link: '/tutorial/cocos2.x',
89+
items: [
90+
{ text: '模板引擎使用', link: '/tutorial/templateengine'},
91+
{ text: 'cocos2.x版本适配', link: '/tutorial/cocos2.x'},
92+
{ text: '加载中效果实现', link: '/tutorial/loading'},
93+
{ text: '平台适配', link: '/tutorial/platform'},
94+
{ text: '缓动系统', link: '/api/tween'},
95+
],
96+
},
97+
{
98+
text: '更多示例',
99+
link:'/demos/invite',
100+
items: [
101+
{ text: '邀请好友组件', link: '/demos/invite'},
102+
{ text: '好有排行榜', link: '/demos/rank'},
103+
],
104+
},
105+
{
106+
text: 'API 文档',
107+
link: '/api/api',
108+
items: [
109+
{ text: 'Layout', link: '/api/api', },
110+
{ text: '布局和样式', link: '/components/overview.md', },
111+
{
112+
text: '组件',
113+
link: '/components/element.md',
114+
items: [
115+
{ text: 'Element', link: '/components/element.md', },
116+
{ text: 'View', link: '/components/view.md', },
117+
{ text: 'Image', link: '/components/image.md', },
118+
{ text: 'Text', link: '/components/text.md', },
119+
{ text: 'BitmapText', link: '/components/bitmapfont.md', },
120+
{ text: 'Canvas', link: '/components/canvas.md', },
121+
{ text: 'ScrollView', link: '/components/scrollview.md', },
122+
]
123+
},
124+
],
125+
},
126+
{
127+
text: '插件机制',
128+
link: '/plugin/guide',
129+
items: [
130+
{ text: '概览', link: '/plugin/guide', },
131+
{ text: '富文本插件', link: '/plugin/richtext'}
132+
],
133+
},
134+
{
135+
text: '更新日志',
136+
link: '/CHANGELOG',
137+
}
138+
],
139+
140+
socialLinks: [
141+
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
142+
]
143+
}
144+
})

docs/.vitepress/theme/custom.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
@media (min-width: 1280px) {
3+
.content {
4+
min-width: 960px !important;
5+
}
6+
}
7+
8+
.VPDoc.has-aside .content-container {
9+
max-width: 960px !important;
10+
}
11+
12+
:root {
13+
--vp-home-hero-name-color: transparent;
14+
--vp-home-hero-name-background: -webkit-linear-gradient(120deg, #f69f41, #fbc662, #fea649);
15+
--vp-c-brand-1: #fa9c47;
16+
--vp-c-brand-2: rgba(251, 197, 98, 0.95);
17+
--vp-c-brand-3: #fa9c47;
18+
--vp-sidebar-width: 295px;
19+
}

docs/.vitepress/theme/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import DefaultTheme from 'vitepress/theme'
2+
import './custom.css'
3+
4+
export default DefaultTheme

docs/.vuepress/config.js

Lines changed: 0 additions & 117 deletions
This file was deleted.

docs/.vuepress/styles/index.scss

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/api/tags.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ title: {
9999

100100

101101
### 示例
102-
<img :src="$withBase('/imgs/bitmapfont.png')" width=400>
102+
<img :src="imgs/bitmapfont.png" width=400>
103103

104104
## canvas
105105
### 特殊属性

0 commit comments

Comments
 (0)