Skip to content

Commit 1dc0f12

Browse files
committed
fix:优化整体内容说明和标准化
1 parent c14f030 commit 1dc0f12

64 files changed

Lines changed: 665 additions & 797 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@
1010

1111
[https://www.spiritlhl.net/en/](https://www.spiritlhl.net/en/)
1212

13-
一键虚拟化项目(One click virtualization)
13+
一键虚拟化项目文档站点(OneClickVirt documentation site)
1414

15-
Documentation for one-click virtualization
15+
提供 Proxmox VE、Incus、LXD、Docker 等虚拟化项目的一键安装与使用说明,同时收录相关工具与扩展项目文档。
1616

17-
一键安装与使用 Proxmox-VE、incus、LXD、Docker 的说明文档,同时包含其他项目指南
18-
19-
Documentation for one-click installation and use of Proxmox-VE, incus, LXD, Docker, and other project guides
17+
Documentation for one-click installation and usage of Proxmox VE, Incus, LXD, Docker, and related tools in the OneClickVirt ecosystem.
2018

2119
```
2220
webvirtcloud
@@ -30,9 +28,9 @@ bashvm
3028
webvirtmgr
3129
```
3230

33-
支持中英双语
31+
支持中英双语
3432

35-
Supports both Chinese and English
33+
Chinese and English are both supported.
3634

3735
## OneClickVirt
3836

docs/.vitepress/config.mts

Lines changed: 69 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,69 @@
1-
import { createWriteStream } from 'node:fs';
2-
import { resolve } from 'node:path';
3-
import { SitemapStream } from 'sitemap';
41
import { defineConfig } from 'vitepress';
52

6-
const links: { url: string; lastmod: number }[] = [];
3+
const SITE_URL = 'https://www.spiritlhl.net';
4+
5+
function toSitePath(relativePath: string) {
6+
return `/${relativePath}`
7+
.replace(/\/index\.md$/, '/')
8+
.replace(/\.md$/, '.html');
9+
}
10+
11+
function toCanonicalUrl(relativePath: string) {
12+
return new URL(toSitePath(relativePath), `${SITE_URL}/`).toString();
13+
}
14+
15+
function getDefaultTitle(relativePath: string) {
16+
return relativePath.startsWith('en/')
17+
? 'OneClickVirt'
18+
: '一键虚拟化项目';
19+
}
20+
21+
function getLocaleCode(relativePath: string) {
22+
return relativePath.startsWith('en/') ? 'en_US' : 'zh_CN';
23+
}
724

825
export default defineConfig({
926
lastUpdated: true,
1027
lang: 'zh-CN',
28+
sitemap: {
29+
hostname: SITE_URL,
30+
transformItems(items) {
31+
return items.filter((item) => !/\/404(?:\.html)?$/.test(item.url));
32+
},
33+
},
1134
markdown: {
1235
lineNumbers: true,
1336
image: {
1437
lazyLoading: true,
1538
},
1639
},
17-
transformHtml: (_, id, { pageData }) => {
18-
if (!/[\\/]404\.html$/.test(id)) {
19-
links.push({
20-
url: pageData.relativePath.replace(/\/index\.md$/, '/').replace(/\.md$/, '.html'),
21-
lastmod: pageData.lastUpdated ?? Date.now(),
22-
});
40+
transformPageData(pageData) {
41+
if (pageData.relativePath === '404.md') {
42+
return;
43+
}
44+
45+
const canonicalUrl = toCanonicalUrl(pageData.relativePath);
46+
const title = pageData.title || getDefaultTitle(pageData.relativePath);
47+
const description = pageData.description || '';
48+
49+
pageData.frontmatter.head ??= [];
50+
pageData.frontmatter.head.push(
51+
['link', { rel: 'canonical', href: canonicalUrl }],
52+
['meta', { property: 'og:type', content: 'article' }],
53+
['meta', { property: 'og:site_name', content: getDefaultTitle(pageData.relativePath) }],
54+
['meta', { property: 'og:locale', content: getLocaleCode(pageData.relativePath) }],
55+
['meta', { property: 'og:title', content: title }],
56+
['meta', { property: 'og:url', content: canonicalUrl }],
57+
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
58+
['meta', { name: 'twitter:title', content: title }],
59+
);
60+
61+
if (description) {
62+
pageData.frontmatter.head.push(
63+
['meta', { property: 'og:description', content: description }],
64+
['meta', { name: 'twitter:description', content: description }],
65+
);
2366
}
24-
},
25-
buildEnd: async ({ outDir }) => {
26-
const sitemap = new SitemapStream({
27-
hostname: 'https://www.spiritlhl.net/'
28-
});
29-
const writeStream = createWriteStream(resolve(outDir, 'sitemap.xml'));
30-
sitemap.pipe(writeStream);
31-
links.forEach((link) => sitemap.write(link));
32-
sitemap.end();
33-
await new Promise((r) => writeStream.on('finish', r));
3467
},
3568
head: [
3669
['link', { rel: 'icon', href: 'https://cdn.spiritlhl.net/https://raw.githubusercontent.com/spiritlhls/pages/main/logo.png' }],
@@ -125,7 +158,7 @@ export default defineConfig({
125158
en: {
126159
lang: 'en-US',
127160
label: 'English',
128-
title: 'One Click Virtualization',
161+
title: 'OneClickVirt',
129162
description: 'Open source, easy to use server virtualization project',
130163
link: '/en/',
131164
themeConfig: {
@@ -142,7 +175,7 @@ export default defineConfig({
142175
externalLinkIcon: true,
143176
nav: [
144177
{
145-
text: 'Virtualization Platforms',
178+
text: 'Platforms',
146179
activeMatch: '^/en/guide/',
147180
items: [
148181
{ text: 'OneClickVirt', link: '/en/guide/oneclickvirt/oneclickvirt_precheck.html' },
@@ -158,7 +191,7 @@ export default defineConfig({
158191
]
159192
},
160193
{
161-
text: 'Other Virtualization Projects',
194+
text: 'Other Projects',
162195
activeMatch: '^/en/incomplete/',
163196
items: [
164197
{ text: 'webvirtcloud', link: '/en/incomplete/webvirtcloud.html' },
@@ -173,7 +206,7 @@ export default defineConfig({
173206
]
174207
},
175208
{
176-
text: 'Utility Projects',
209+
text: 'Utilities',
177210
activeMatch: '^/en/case/',
178211
items: [
179212
{ text: '1. ECS benchmark script for VPS', link: '/en/case/case1.html' },
@@ -207,14 +240,17 @@ export default defineConfig({
207240
},
208241
themeConfig: {
209242
outline: 'deep',
243+
search: {
244+
provider: 'algolia',
245+
options: {
246+
appId: 'K1R85MDU0C',
247+
apiKey: '9375787ec1c00e2b813683fbbde25ae2',
248+
indexName: 'virt-spiritlhl'
249+
}
250+
},
210251
socialLinks: [
211252
{ icon: 'github', link: 'https://github.com/oneclickvirt' }
212253
],
213-
algolia: {
214-
appId: 'K1R85MDU0C',
215-
apiKey: '9375787ec1c00e2b813683fbbde25ae2',
216-
indexName: 'virt-spiritlhl'
217-
},
218254
footer: {
219255
message: 'Under <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">(CC BY-NC-SA 4.0) License.</a><br>Also thanks to <a href="https://www.cloudflare.com/">Cloudflare</a> and <a href="https://blog.tanglu.me/">tanglu.me</a> for the CDN.',
220256
copyright: 'Copyright © 2022-present oneclickvirt'
@@ -282,7 +318,7 @@ function getGuideSidebarZhCN() {
282318
{ text: 'Docker主体安装', link: '/guide/docker/docker_install.html' },
283319
{ text: 'Linux容器(LXC)', link: '/guide/docker/docker_build.html' },
284320
{ text: 'Windows虚拟机(KVM/QEMU)', link: '/guide/docker/docker_windows.html' },
285-
{ text: 'Macos虚拟机(KVM)', link: '/guide/docker/docker_macos.html' },
321+
{ text: 'macOS虚拟机(KVM)', link: '/guide/docker/docker_macos.html' },
286322
{ text: 'Android虚拟机(KVM/QEMU)', link: '/guide/docker/docker_android.html' },
287323
{ text: '自定义', link: '/guide/docker/docker_custom.html' },
288324
{ text: '致谢', link: '/guide/docker/docker_thanks.html' },
@@ -479,7 +515,7 @@ function getGuideSidebarEnUS() {
479515
{ text: 'Docker main installation', link: '/en/guide/docker/docker_install.html' },
480516
{ text: 'Linux Container(LXC)', link: '/en/guide/docker/docker_build.html' },
481517
{ text: 'Windows Virtual Machine(KVM/QEMU)', link: '/en/guide/docker/docker_windows.html' },
482-
{ text: 'Macos Virtual Machine(KVM)', link: '/en/guide/docker/docker_macos.html' },
518+
{ text: 'macOS Virtual Machine(KVM)', link: '/en/guide/docker/docker_macos.html' },
483519
{ text: 'Android Virtual Machine(KVM/QEMU)', link: '/en/guide/docker/docker_android.html' },
484520
{ text: 'Custom', link: '/en/guide/docker/docker_custom.html' },
485521
{ text: 'Acknowledgements', link: '/en/guide/docker/docker_thanks.html' },
@@ -551,9 +587,9 @@ function getGuideSidebarEnUS() {
551587
items: [
552588
{ text: 'via iptables', link: '/en/guide/block/block_iptables.html' },
553589
{ text: 'In PVE', link: '/en/guide/block/block_pve.html' },
554-
{ text: 'In INCUS', link: '/en/guide/block/block_incus.html' },
590+
{ text: 'In Incus', link: '/en/guide/block/block_incus.html' },
555591
{ text: 'In LXD', link: '/en/guide/block/block_lxd.html' },
556-
{ text: 'In DOCKER', link: '/en/guide/block/block_docker.html' },
592+
{ text: 'In Docker', link: '/en/guide/block/block_docker.html' },
557593
]
558594
},
559595
{

docs/.vitepress/theme/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import DefaultTheme from 'vitepress/theme'
22
import { h } from 'vue'
33
import ComponentInHeader from '../../components/ComponentInHeader.vue'
4+
import './style.css'
45

56
export default {
67
extends: DefaultTheme,

docs/.vitepress/theme/style.css

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
@media (min-width: 768px) {
2+
html[lang^='en'] .VPNavBar .content,
3+
html[lang^='en'] .VPNavBar .menu,
4+
html[lang^='en'] .VPNavBar .menu > * {
5+
min-width: 0;
6+
}
7+
8+
html[lang^='en'] .VPNavBar .content-body,
9+
html[lang^='en'] .VPNavBar .menu {
10+
overflow: hidden;
11+
}
12+
13+
html[lang^='en'] .VPNavBar .menu {
14+
flex: 1 1 auto;
15+
justify-content: flex-end;
16+
}
17+
18+
html[lang^='en'] .VPNavBar .translations,
19+
html[lang^='en'] .VPNavBar .appearance,
20+
html[lang^='en'] .VPNavBar .social-links,
21+
html[lang^='en'] .VPNavBar .extra {
22+
flex-shrink: 0;
23+
}
24+
25+
html[lang^='en'] .VPNavBar .VPNavBarMenuLink,
26+
html[lang^='en'] .VPNavBar .VPNavBarMenuGroup .button {
27+
min-width: 0;
28+
max-width: clamp(96px, 11vw, 168px);
29+
overflow: hidden;
30+
}
31+
32+
html[lang^='en'] .VPNavBar .VPNavBarMenuLink > span,
33+
html[lang^='en'] .VPNavBar .VPNavBarMenuGroup .button .text {
34+
overflow: hidden;
35+
text-overflow: ellipsis;
36+
}
37+
}

docs/case/case1.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ outline: deep
1010

1111
[![Hits](https://hits.spiritlhl.net/goecs.svg?action=hit&title=Hits&title_bg=%23555555&count_bg=%230eecf8&edge_flat=false)](https://hits.spiritlhl.net) [![Downloads](https://ghdownload.spiritlhl.net/oneclickvirt/ecs?color=36c600)](https://github.com/oneclickvirt/ecs/releases)
1212

13-
融合怪测评项目 - GO版本
13+
融合怪测评项目 - Go 版本
1414

15-
(仅环境安装[非必须]使用shell外无额外shell文件依赖,环境安装只是为了测的更准,极端情况下无环境依赖安装也可全测项目)
15+
除可选的环境安装步骤仍会调用 shell 外,项目本体不依赖额外 shell 文件。环境安装只是为了提升测试准确度,极端情况下即使不安装这些依赖,也依然可以完成大部分测试。
1616

1717
如有问题请 [issues](https://github.com/oneclickvirt/ecs/issues) 反馈。
1818

@@ -43,7 +43,7 @@ Shell 版本:[https://github.com/spiritLHLS/ecs](https://github.com/spiritLHLS
4343

4444
| 系统 | 说明 |
4545
|----------------|---------------------------|
46-
| OpenBSD/NetBSD | 部分Goalng的官方库未支持本系统(尤其是net相关项目) |
46+
| OpenBSD/NetBSD | 部分Golang的官方库暂未支持本系统(尤其是 net 相关项目) |
4747

4848
---
4949

@@ -58,7 +58,7 @@ Shell 版本:[https://github.com/spiritLHLS/ecs](https://github.com/spiritLHLS
5858
- 邮件端口测试:[portchecker](https://github.com/oneclickvirt/portchecker)
5959
- 上游及回程路由线路检测:借鉴 [zhanghanyun/backtrace](https://github.com/zhanghanyun/backtrace),二次开发至 [oneclickvirt/backtrace](https://github.com/oneclickvirt/backtrace)
6060
- 三网路由测试:基于 [NTrace-core](https://github.com/nxtrace/NTrace-core),二次开发至 [nt3](https://github.com/oneclickvirt/nt3)
61-
- 网速测试:基于 [speedtest.net](https://github.com/spiritLHLS/speedtest.net-CN-ID)[speedtest.cn](https://github.com/spiritLHLS/speedtest.cn-CN-ID) 数据,开发至 [oneclickvirt/speedtest](https://github.com/oneclickvirt/speedtest)
61+
- 网速测试:基于 [speedtest.net](https://github.com/spiritLHLS/speedtest.net-CN-ID)[speedtest.cn](https://github.com/spiritLHLS/speedtest.cn-CN-ID) 数据,开发至 [oneclickvirt/speedtest](https://github.com/oneclickvirt/speedtest),同时融合私有国内测速节点
6262
- 三网 Ping 值测试:借鉴 [ecsspeed](https://github.com/spiritLHLS/ecsspeed),二次开发至 [pingtest](https://github.com/oneclickvirt/pingtest)
6363
- 支持root或admin环境下测试,支持非root或非admin环境下测试,支持离线环境下进行测试,**暂未**支持无DNS的在线环境下进行测试
6464

@@ -89,7 +89,7 @@ Shell 版本:[https://github.com/spiritLHLS/ecs](https://github.com/spiritLHLS
8989
- **国内用户使用 CNB 加速:**
9090

9191
```bash
92-
export noninteractive=true && curl -L https://cnb.cool/oneclickvirt/ecs/-/git/raw/main/goecs.sh -o goecs.sh && chmod +x goecs.sh && ./goecs.sh install && goecs
92+
export noninteractive=true && export CN=true && curl -L https://cnb.cool/oneclickvirt/ecs/-/git/raw/main/goecs.sh -o goecs.sh && chmod +x goecs.sh && ./goecs.sh install && goecs
9393
```
9494

9595
- **短链接:**
@@ -130,7 +130,7 @@ Shell 版本:[https://github.com/spiritLHLS/ecs](https://github.com/spiritLHLS
130130
**国内用户使用 CNB 加速:**
131131

132132
```bash
133-
curl -L https://cnb.cool/oneclickvirt/ecs/-/git/raw/main/goecs.sh -o goecs.sh && chmod +x goecs.sh
133+
export CN=true && curl -L https://cnb.cool/oneclickvirt/ecs/-/git/raw/main/goecs.sh -o goecs.sh && chmod +x goecs.sh
134134
```
135135

136136
2. **更新包管理器(可选择)并安装环境**
@@ -268,8 +268,8 @@ Usage: goecs [options]
268268
1. 下载带 exe 文件的压缩包:[Releases](https://github.com/oneclickvirt/ecs/releases)
269269
2. 解压后,右键以管理员模式运行。
270270

271-
PS:如果是虚拟机环境,不以管理员模式运行也行,因为虚拟机无原生的测试工具,将自动启用替代方法测试
272-
PPS: 暂时不要下载带GUI标签的exe文件,未完整适配,CI版本的压缩包是没问题的
271+
PS:如果是在虚拟机环境中运行,不以管理员模式启动通常也可以,因为虚拟机缺少部分原生测试工具时会自动启用替代方案
272+
PPS:暂时不要下载带 GUI 标签的 exe 文件,相关适配还不完整,优先使用常规 CI 产物压缩包
273273

274274
---
275275

@@ -312,7 +312,7 @@ docker run --rm --privileged --network host crpi-8tmognxgyb86bm61.cn-guangzhou.p
312312
docker run --rm crpi-8tmognxgyb86bm61.cn-guangzhou.personal.cr.aliyuncs.com/oneclickvirt/ecs:latest -menu=false -l zh
313313
```
314314

315-
实际上还有CNB镜像地址 https://cnb.cool/oneclickvirt/ecs/-/packages/docker/ecs 但很可惜组织空间不足无法推送了,更推荐使用阿里云镜像加速
315+
实际上还有 CNB 镜像地址 https://cnb.cool/oneclickvirt/ecs/-/packages/docker/ecs ,但由于组织空间不足,目前无法继续推送,因此更推荐直接使用阿里云镜像加速。
316316

317317
</details>
318318

@@ -331,7 +331,7 @@ cd ecs
331331

332332
2. 安装 Go 环境(如已安装可跳过)
333333

334-
选择 go 1.25.3 的版本进行安装
334+
选择 Go 1.25.4 版本进行安装
335335

336336
```bash
337337
curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/go.sh -o go.sh && chmod +x go.sh && bash go.sh
@@ -394,11 +394,11 @@ GOOS=darwin GOARCH=amd64 go build -o goecs_darwin
394394

395395
#### Q: 测试进行到一半如何手动终止?
396396

397-
#### A: 按ctrl键和c键终止程序,终止后依然会在当前目录下生成goecs.txt文件和分享链接,里面是已经测试到的信息
397+
#### A: `Ctrl+C` 终止程序。终止后依然会在当前目录下生成 `goecs.txt` 文件和分享链接,里面会保留已经完成的测试结果
398398

399399
#### Q: 非Root环境如何进行测试?
400400

401-
#### A: 手动执行安装命令,实在装不上也没问题,直接在release中下载对应架构的压缩包解压后执行即可,只要你能执行的了文件。或者你能使用docker的话用docker执行
401+
#### A: 可以先尝试手动执行安装命令。若确实无法安装依赖,也没关系,直接去 release 页面下载对应架构的压缩包,解压后执行即可,只要当前环境允许运行该文件。若可用 Docker,也可以直接通过 Docker 运行
402402

403403
## 致谢
404404

0 commit comments

Comments
 (0)