Skip to content

Commit fbca71b

Browse files
committed
update docs
1 parent 93b574c commit fbca71b

26 files changed

+2913
-2845
lines changed

.github/workflows/deploy.yml

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
name: Deploy VitePress Site
2-
3-
on:
4-
push:
5-
branches: [main]
6-
7-
permissions:
8-
contents: read
9-
pages: write
10-
id-token: write
11-
12-
concurrency:
13-
group: pages
14-
cancel-in-progress: true
15-
16-
jobs:
17-
build:
18-
runs-on: ubuntu-latest
19-
steps:
20-
- name: Checkout
21-
uses: actions/checkout@v4
22-
23-
- name: Setup Node.js
24-
uses: actions/setup-node@v4
25-
with:
26-
node-version: 18
27-
28-
- name: Install dependencies
29-
run: npm install
30-
31-
- name: Build docs
32-
run: npx vitepress build docs
33-
34-
- name: Upload artifact
35-
uses: actions/upload-pages-artifact@v3
36-
with:
37-
path: docs/.vitepress/dist
38-
39-
deploy:
40-
environment:
41-
name: github-pages
42-
url: ${{ steps.deployment.outputs.page_url }}
43-
runs-on: ubuntu-latest
44-
needs: build
45-
steps:
46-
- name: Deploy to GitHub Pages
1+
name: Deploy VitePress Site
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: pages
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 18
27+
28+
- name: Install dependencies
29+
run: npm install
30+
31+
- name: Build docs
32+
run: npx vitepress build docs
33+
34+
- name: Upload artifact
35+
uses: actions/upload-pages-artifact@v3
36+
with:
37+
path: docs/.vitepress/dist
38+
39+
deploy:
40+
environment:
41+
name: github-pages
42+
url: ${{ steps.deployment.outputs.page_url }}
43+
runs-on: ubuntu-latest
44+
needs: build
45+
steps:
46+
- name: Deploy to GitHub Pages
4747
uses: actions/deploy-pages@v4

docs/.vitepress/config.mts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ export default defineConfig({
2121
]
2222
},
2323
{ text: '预览', link: '/preview/preview.html'},
24-
{ text: '使用说明', link: '/use/use-generalizations.html'},
24+
{
25+
text: '使用说明',
26+
items: [
27+
{ text: '基础功能使用说明', link: '/use/basic.html'},
28+
{ text: '数据库功能使用说明', link: '/use/database.html'}
29+
]
30+
},
2531
{ text: '功能原理', link: '/develop/fragmented-thoughts.html'}
2632
],
2733

@@ -39,6 +45,13 @@ export default defineConfig({
3945
{ text: '预览', link: '/preview/preview.html' },
4046
]
4147
},
48+
{
49+
text: '使用说明',
50+
items: [
51+
{ text: '基础功能使用说明', link: '/use/basic.html'},
52+
{ text: '数据库功能使用说明', link: '/use/database.html'}
53+
]
54+
},
4255
{
4356
text: '功能原理',
4457
items: [
@@ -48,7 +61,6 @@ export default defineConfig({
4861
items: [
4962
{ text: '顶栏', link: '/develop/beautification/navbar.html' },
5063
{ text: '字体', link: '/develop/beautification/font-family.html' },
51-
{ text: '排行榜', link: '/develop/beautification/rank.html' },
5264
{ text: '背景颜色', link: '/develop/beautification/background-color.html' },
5365
{ text: '其他', link: '/develop/beautification/other.html' }
5466
]

docs/.vitepress/theme/index.ts

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
import DefaultTheme from 'vitepress/theme'
2-
import './style/index.css'
3-
4-
// 彩虹背景动画样式
5-
let homePageStyle: HTMLStyleElement | undefined
6-
export default {
7-
extends: DefaultTheme,
8-
9-
// enhanceApp({app , router }) {
10-
// // 彩虹背景动画样式
11-
// if (typeof window !== 'undefined') {
12-
// watch(
13-
// () => router.route.data.relativePath,
14-
// () => updateHomePageStyle(location.pathname === '/'),
15-
// { immediate: true },
16-
// )
17-
// }
18-
19-
// },
20-
}
21-
// 彩虹背景动画样式
22-
function updateHomePageStyle(value: boolean) {
23-
if (value) {
24-
if (homePageStyle) return
25-
26-
homePageStyle = document.createElement('style')
27-
homePageStyle.innerHTML = `
28-
:root {
29-
animation: rainbow 12s linear infinite;
30-
}`
31-
document.body.appendChild(homePageStyle)
32-
} else {
33-
if (!homePageStyle) return
34-
35-
homePageStyle.remove()
36-
homePageStyle = undefined
37-
}
1+
import DefaultTheme from 'vitepress/theme'
2+
import './style/index.css'
3+
4+
// 彩虹背景动画样式
5+
let homePageStyle: HTMLStyleElement | undefined
6+
export default {
7+
extends: DefaultTheme,
8+
9+
// enhanceApp({app , router }) {
10+
// // 彩虹背景动画样式
11+
// if (typeof window !== 'undefined') {
12+
// watch(
13+
// () => router.route.data.relativePath,
14+
// () => updateHomePageStyle(location.pathname === '/'),
15+
// { immediate: true },
16+
// )
17+
// }
18+
19+
// },
20+
}
21+
// 彩虹背景动画样式
22+
function updateHomePageStyle(value: boolean) {
23+
if (value) {
24+
if (homePageStyle) return
25+
26+
homePageStyle = document.createElement('style')
27+
homePageStyle.innerHTML = `
28+
:root {
29+
animation: rainbow 12s linear infinite;
30+
}`
31+
document.body.appendChild(homePageStyle)
32+
} else {
33+
if (!homePageStyle) return
34+
35+
homePageStyle.remove()
36+
homePageStyle = undefined
37+
}
3838
}
Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
/* .vitepress\theme\style\blur.css */
2-
:root {
3-
4-
/* 首页下滑后导航透明 */
5-
.VPNavBar:not(.has-sidebar):not(.home.top) {
6-
background-color: rgba(255, 255, 255, 0);
7-
backdrop-filter: blur(10px);
8-
}
9-
10-
/* 搜索框透明 */
11-
.DocSearch-Button {
12-
background-color: rgba(255, 255, 255, 0);
13-
backdrop-filter: blur(10px);
14-
}
15-
16-
/* Feature透明 */
17-
.VPFeature {
18-
border: 1px solid transparent;
19-
box-shadow: 0 10px 30px 0 rgb(0 0 0 / 15%);
20-
background-color: transparent;
21-
}
22-
23-
/* 文档页侧边栏顶部透明 */
24-
.curtain {
25-
background-color: rgba(255, 255, 255, 0);
26-
backdrop-filter: blur(10px);
27-
}
28-
29-
@media (min-width: 960px) {
30-
31-
/* 文档页导航中间透明 */
32-
.VPNavBar:not(.home.top) .content-body {
33-
background-color: rgba(255, 255, 255, 0);
34-
backdrop-filter: blur(10px);
35-
}
36-
}
37-
38-
/* 移动端大纲栏透明 */
39-
.VPLocalNav {
40-
background-color: rgba(255, 255, 255, 0);
41-
backdrop-filter: blur(10px);
42-
}
43-
1+
/* .vitepress\theme\style\blur.css */
2+
:root {
3+
4+
/* 首页下滑后导航透明 */
5+
.VPNavBar:not(.has-sidebar):not(.home.top) {
6+
background-color: rgba(255, 255, 255, 0);
7+
backdrop-filter: blur(10px);
8+
}
9+
10+
/* 搜索框透明 */
11+
.DocSearch-Button {
12+
background-color: rgba(255, 255, 255, 0);
13+
backdrop-filter: blur(10px);
14+
}
15+
16+
/* Feature透明 */
17+
.VPFeature {
18+
border: 1px solid transparent;
19+
box-shadow: 0 10px 30px 0 rgb(0 0 0 / 15%);
20+
background-color: transparent;
21+
}
22+
23+
/* 文档页侧边栏顶部透明 */
24+
.curtain {
25+
background-color: rgba(255, 255, 255, 0);
26+
backdrop-filter: blur(10px);
27+
}
28+
29+
@media (min-width: 960px) {
30+
31+
/* 文档页导航中间透明 */
32+
.VPNavBar:not(.home.top) .content-body {
33+
background-color: rgba(255, 255, 255, 0);
34+
backdrop-filter: blur(10px);
35+
}
36+
}
37+
38+
/* 移动端大纲栏透明 */
39+
.VPLocalNav {
40+
background-color: rgba(255, 255, 255, 0);
41+
backdrop-filter: blur(10px);
42+
}
43+
4444
}

0 commit comments

Comments
 (0)