Skip to content

Commit 69b9502

Browse files
committed
refactor: build site with vitepress
1 parent 18f83ff commit 69b9502

24 files changed

+2896
-162
lines changed

Diff for: .github/workflows/branch-merge.yml

-17
This file was deleted.

Diff for: .github/workflows/deploy.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build and deploy
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
jobs:
9+
docs:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 22
21+
cache: npm
22+
23+
- name: Setup Pages
24+
uses: actions/configure-pages@v4
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Build with VitePress
30+
run: npm run docs:build
31+
32+
- name: Deploy to GitHub Pages
33+
uses: crazy-max/ghaction-github-pages@v4
34+
with:
35+
target_branch: gh-pages
36+
build_dir: docs/.vitepress/dist
37+
fqdn: dsa.doocs.org
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
41+
build:
42+
runs-on: ubuntu-latest
43+
if: github.repository == 'doocs/data-structure-and-algorithm'
44+
needs: docs
45+
steps:
46+
- name: Sync to Gitee
47+
uses: wearerequired/git-mirror-action@master
48+
env:
49+
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
50+
with:
51+
source-repo: [email protected]:doocs/data-structure-and-algorithm.git
52+
destination-repo: [email protected]:Doocs/data-structure-and-algorithm.git

Diff for: .github/workflows/gradle.yml

-36
This file was deleted.

Diff for: .github/workflows/prettier.yml

-25
This file was deleted.

Diff for: .github/workflows/sync.yml

-25
This file was deleted.

Diff for: .gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,9 @@ local.properties
3131
.DS_Store
3232
gradle.properties
3333

34-
.vscode
34+
.vscode
35+
36+
docs/.vitepress/dist
37+
docs/.vitepress/cache
38+
39+
node_modules

Diff for: CNAME

-1
This file was deleted.

Diff for: docs/.vitepress/config.mts

+193
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
import { defineConfig } from 'vitepress'
2+
3+
// https://vitepress.dev/reference/site-config
4+
export default defineConfig({
5+
title: "DS and Algo",
6+
description: "必知必会:数据结构与算法",
7+
themeConfig: {
8+
// https://vitepress.dev/reference/default-theme-config
9+
nav: [
10+
{ text: '首页', link: '/' },
11+
{ text: '阅读', link: '/getting-started' }
12+
],
13+
search: {
14+
provider: 'local'
15+
},
16+
footer: {
17+
message: 'Released under the CC-BY-SA-4.0 license.',
18+
copyright: `Copyright © 2018-${new Date().getFullYear()} <a href="https://github.com/doocs">Doocs</a>`
19+
},
20+
logo: '/doocs.png',
21+
docFooter: {
22+
prev: '上一页',
23+
next: '下一页'
24+
},
25+
editLink: {
26+
pattern: 'https://github.com/doocs/data-structure-and-algorithm/edit/main/:path',
27+
text: '在 GitHub 编辑'
28+
},
29+
30+
sidebar: [
31+
{
32+
text: '数据结构与算法',
33+
items: [
34+
{ text: '数据结构的划分', link: '/linear-vs-nonlinear-data-structure.md' },
35+
{ text: '稀疏矩阵和队列', link: '/the-introduction-to-sparse-matrix.md' },
36+
{
37+
text: '堆栈',
38+
collapsed: true,
39+
items: [
40+
{ text: '堆栈', link: '/stack-introduction.md' },
41+
{ text: '堆栈的实现', link: '' }
42+
]
43+
},
44+
{
45+
text: '队列',
46+
collapsed: true,
47+
items: [
48+
{ text: '队列介绍', link: '/queue-introduction.md' },
49+
{ text: '队列的一个使用场景', link: '/queue-usage.md' },
50+
{ text: '数组模拟队列的思路', link: '' },
51+
{ text: '数组模拟环形队列', link: '' }
52+
]
53+
},
54+
{
55+
text: '链表',
56+
collapsed: true,
57+
items: [
58+
{ text: '链表介绍', link: '' },
59+
{ text: '单链表应用实例', link: '' },
60+
{ text: '单链表大厂面试题', link: '' },
61+
{ text: '双向链表应用实例', link: '' },
62+
{ text: '单向环形链表应用场景', link: '' },
63+
{ text: '单向环形链表介绍', link: '' },
64+
{ text: '约瑟夫问题', link: '' }
65+
]
66+
},
67+
{
68+
text: '栈',
69+
collapsed: true,
70+
items: [
71+
{ text: '栈的一个实际需求', link: '' },
72+
{ text: '栈的介绍', link: '' },
73+
{ text: '栈的应用场景', link: '' },
74+
{ text: '栈的快速入门', link: '' },
75+
{ text: '栈实现综合计算器', link: '' },
76+
{ text: '逆波兰计算器', link: '' },
77+
{ text: '中缀表达式转换为后缀表达式', link: '' }
78+
]
79+
},
80+
{
81+
text: '递归',
82+
collapsed: true,
83+
items: [
84+
{ text: '递归与递归调用机制', link: '' },
85+
{ text: '递归-迷宫问题', link: '' },
86+
{ text: '递归-八皇后问题(回溯算法)', link: '' }
87+
]
88+
},
89+
{
90+
text: '排序算法',
91+
collapsed: true,
92+
items: [
93+
{ text: '排序算法介绍', link: '' },
94+
{ text: '算法的时空复杂度', link: '' },
95+
{ text: '冒泡排序', link: '' },
96+
{ text: '选择排序', link: '' },
97+
{ text: '插入排序', link: '' },
98+
{ text: '希尔排序', link: '' },
99+
{ text: '快速排序', link: '' },
100+
{ text: '归并排序', link: '' },
101+
{ text: '基数排序', link: '' },
102+
{ text: '常用排序算法对比总结', link: '' }
103+
]
104+
},
105+
{
106+
text: '查找算法',
107+
collapsed: true,
108+
items: [
109+
{ text: '线性查找算法', link: '' },
110+
{ text: '二分查找算法', link: '' },
111+
{ text: '插值查找算法', link: '' },
112+
{ text: '斐波那契(黄金分割法)查找算法', link: '' }
113+
]
114+
},
115+
{
116+
text: '哈希表',
117+
collapsed: true,
118+
items: [
119+
{ text: '哈希表的基本介绍', link: '' },
120+
{ text: 'Google 公司的一个上机题', link: '' }
121+
]
122+
},
123+
{
124+
text: '树结构',
125+
collapsed: true,
126+
items: [
127+
{ text: '二叉树', link: '' },
128+
{ text: '顺序存储二叉树', link: '' },
129+
{ text: '线索化二叉树', link: '' }
130+
]
131+
},
132+
{
133+
text: '树结构应用',
134+
collapsed: true,
135+
items: [
136+
{ text: '堆排序', link: '' },
137+
{ text: '赫夫曼树', link: '' },
138+
{ text: '赫夫曼编码', link: '' },
139+
{ text: '二叉排序树', link: '' },
140+
{ text: '平衡二叉树(AVL 树)', link: '' }
141+
]
142+
},
143+
{
144+
text: '多路查找树',
145+
collapsed: true,
146+
items: [
147+
{ text: '二叉树与 B 树', link: '' },
148+
{ text: 'B 树、B+ 树和 B* 树', link: '' }
149+
]
150+
},
151+
{
152+
text: '图',
153+
collapsed: true,
154+
items: [
155+
{ text: '图基本介绍', link: '' },
156+
{ text: '图的表示方式', link: '' },
157+
{ text: '图的深度优先遍历', link: '' },
158+
{ text: '图的广度优先遍历', link: '' },
159+
{ text: '图的深度优先 VS 广度优先', link: '' }
160+
]
161+
},
162+
{
163+
text: '10 大常用算法',
164+
collapsed: true,
165+
items: [
166+
{ text: '二分查找算法(非递归)', link: '' },
167+
{ text: '分治算法', link: '' },
168+
{ text: '动态规划算法', link: '' },
169+
{ text: 'KMP 算法', link: '' },
170+
{ text: '贪心算法', link: '' },
171+
{ text: '普里姆算法', link: '' },
172+
{ text: '克鲁斯卡尔算法', link: '' },
173+
{ text: '迪杰斯特拉算法', link: '' },
174+
{ text: '弗洛伊德算法', link: '' },
175+
{ text: '马踏棋盘算法', link: '' }
176+
]
177+
}
178+
]
179+
}
180+
],
181+
182+
socialLinks: [
183+
{ icon: 'github', link: 'https://github.com/doocs/data-structure-and-algorithm' }
184+
]
185+
},
186+
head: [
187+
['link', { rel: 'icon', type: 'image/png', href: '/favicon-32x32.png' }],
188+
],
189+
cleanUrls: true,
190+
sitemap: {
191+
hostname: 'https://dsa.doocs.org'
192+
}
193+
})

Diff for: docs/README.md

Whitespace-only changes.

Diff for: docs/extra-page/cover.md

-9
This file was deleted.

0 commit comments

Comments
 (0)